Skip to content

Commit 0570ad3

Browse files
authored
Merge pull request #37 from CommunityToolkit/test-fixes
Test fixes
2 parents 952d75d + 3cb57aa commit 0570ad3

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

Directory.Build.targets

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project>
2+
<Target Name="_SetVSTestLogger" BeforeTargets="VSTest" Condition=" '$(TrxLogFileNameSuffix)' != '' ">
3+
<PropertyGroup>
4+
<VSTestLogger>trx%3BLogFileName=$(AssemblyName)-$(TargetFramework).trx</VSTestLogger>
5+
</PropertyGroup>
6+
</Target>
7+
</Project>

Directory.Packages.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
2727
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.4.0" />
2828
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
29-
<PackageVersion Include="xunit" Version="2.9.0" />
29+
<PackageVersion Include="xunit" Version="2.9.1" />
3030
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
31+
<PackageVersion Include="xunit.extensibility.execution" Version="2.9.1" />
3132
<!-- External packages -->
3233
<PackageVersion Include="OllamaSharp" Version="3.0.7" />
3334
</ItemGroup>

tests/Aspire.CommunityToolkit.Testing/Aspire.CommunityToolkit.Testing.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,14 @@
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88

9+
<ItemGroup>
10+
<!--
11+
This intentionally does not reference 'xunit', 'xunit.core', or any runner packages.
12+
XUnit recommends only using xunit.extensibility.*, xunit.assert, and xunit.abstractions for packages which "extend" xunit.
13+
This allows consumers to decide which type of xunit runner they want to use to run these tests,
14+
and avoids problems with `dotnet pack`.
15+
See https://xunit.github.io/docs/nuget-packages and the special note in https://xunit.github.io/releases/2.3.
16+
-->
17+
<PackageReference Include="xunit.extensibility.execution" />
18+
</ItemGroup>
919
</Project>

tests/Aspire.CommunityToolkit.Testing/XUnit/ConditionalFactAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Microsoft.TestUtilities;
1111

1212
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
13-
[XunitTestCaseDiscoverer("Microsoft.TestUtilities." + nameof(ConditionalFactDiscoverer), "Microsoft.TestUtilities")]
13+
[XunitTestCaseDiscoverer("Microsoft.TestUtilities." + nameof(ConditionalFactDiscoverer), "Aspire.CommunityToolkit.Testing")]
1414
public class ConditionalFactAttribute : FactAttribute
1515
{
1616
}

tests/Aspire.CommunityToolkit.Testing/XUnit/ConditionalTheoryAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Microsoft.TestUtilities;
1111

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

0 commit comments

Comments
 (0)