I know that this question has been asked multiple times before I raise it again, However I still could not get the answer for dotnet 5.0 and xunit
What have I tried.
public class IntegrationTests
{
[Theory]
[MemberData(nameof(Tests), MemberType = typeof(IntegrationTests))]
public void Test(IntegrationTest test)
{
Assert.True(test.Expected, test.Actual);
}
}
dotnet test <path to>.csproj
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
No test is available in C:\<path>\bin\Debug\net5.0\<projectname>.dll.
Make sure that test discoverer & executors are registered and platform & framework
version settings are appropriate and try again.
I don't fully undertand what "test discoverer and executors mean here.
My .csproj file has following nuget packages (since many of the similar questions got resolved by adding one of these)
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.console" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
I was working on a windows machine and I did the following to make it work
C:\Users\<username>\.nuget\packages
folder<projectname>.csproj
and it started picking up the tests again