Skip to content

Commit

Permalink
Merge pull request #37 from CommunityToolkit/test-fixes
Browse files Browse the repository at this point in the history
Test fixes
  • Loading branch information
aaronpowell authored Sep 27, 2024
2 parents 952d75d + 3cb57aa commit 0570ad3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<Target Name="_SetVSTestLogger" BeforeTargets="VSTest" Condition=" '$(TrxLogFileNameSuffix)' != '' ">
<PropertyGroup>
<VSTestLogger>trx%3BLogFileName=$(AssemblyName)-$(TargetFramework).trx</VSTestLogger>
</PropertyGroup>
</Target>
</Project>
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.4.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit" Version="2.9.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="xunit.extensibility.execution" Version="2.9.1" />
<!-- External packages -->
<PackageVersion Include="OllamaSharp" Version="3.0.7" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,14 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<!--
This intentionally does not reference 'xunit', 'xunit.core', or any runner packages.
XUnit recommends only using xunit.extensibility.*, xunit.assert, and xunit.abstractions for packages which "extend" xunit.
This allows consumers to decide which type of xunit runner they want to use to run these tests,
and avoids problems with `dotnet pack`.
See https://xunit.github.io/docs/nuget-packages and the special note in https://xunit.github.io/releases/2.3.
-->
<PackageReference Include="xunit.extensibility.execution" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Microsoft.TestUtilities;

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
[XunitTestCaseDiscoverer("Microsoft.TestUtilities." + nameof(ConditionalFactDiscoverer), "Microsoft.TestUtilities")]
[XunitTestCaseDiscoverer("Microsoft.TestUtilities." + nameof(ConditionalFactDiscoverer), "Aspire.CommunityToolkit.Testing")]
public class ConditionalFactAttribute : FactAttribute
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Microsoft.TestUtilities;

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
[XunitTestCaseDiscoverer("Microsoft.TestUtilities." + nameof(ConditionalTheoryDiscoverer), "Microsoft.TestUtilities")]
[XunitTestCaseDiscoverer("Microsoft.TestUtilities." + nameof(ConditionalTheoryDiscoverer), "Aspire.CommunityToolkit.Testing")]
public class ConditionalTheoryAttribute : TheoryAttribute
{
}

0 comments on commit 0570ad3

Please sign in to comment.