Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSTest Not Finding New Tests

Using VS2010, I can't seem to add additional test methods. If I set up my project like this

[TestMethod]
public void Test1()
{
   Assert.AreNotEqual(0,1);
}

[TestMethod]
public void Test2()
{
   Assert.AreNotEqual(0,1);
}

The only test that shows up in my Test View is Test1. How do I make sure Test2 gets in to that list?

EDIT: Additional tests that weren't initially created are not added to the list of tests. So if I was to add Test3 after running tests, then Test3 would not get added.

like image 607
Blake Blackwell Avatar asked Apr 16 '10 16:04

Blake Blackwell


1 Answers

I ran into the same problem with not discovering new test methods after I had uninstalled ReSharper and updated to Visual Studio 2010 SP1.

I fixed the issue by going to Tools > Options > Test Tools > Test Project and unchecked "Disable background discovery of test methods".

It worked re-opening the solution but not doing a full clean and rebuild.

like image 115
Sigurbjörn Avatar answered Sep 19 '22 15:09

Sigurbjörn