Reputation: 1017
I am facing "test method not found" on visual studio 2017 - Version 15.8.1, When i am trying to run or debug the code from visual studio.
Issue: [Test project {Project Name} does not reference any .NET NuGet adapter. Test discovery or execution might not work for this project. It is recommended to reference NuGet test adapters in each test project in the solution. ]
Note: I am able to solve the above error on visual studio 2017 versions 15.7.* using below link.
Please note this is not duplicate of - "Visual Studio 17: Facing Test Case not found issue in Visual Studio 17" or any other question already in stack overflow.
If you have the same version. It can be reproduced using this code.
[TestClass]
public class ATest : ATestBase
{
[TestInitialize]
public override void TestInitialize()
{
if (Playback.IsInitialized == false)
Playback.Initialize();
}
[TestCleanup]
public override void TestCleanup()
{
if (Playback.IsInitialized == true)
Playback.Cleanup();
base.TestCleanup();
}
[TestMethod, TestCategory("SmokeTest")]
[DeploymentItem(@"DataSource\Documents\some.pdf")]
public void SmokeFlow()
{
string name = "test";
}
}
Upvotes: 2
Views: 6573
Reputation: 1017
Starting Visual studio 2017 version 15.8 and on wards. A new option is added under tools -> options -> test as shown in screenshot. Uncheck the option and restart your visual studio. This solves the issue.
Upvotes: 6