Why does visual studio 2012 not find my tests?

后端 未结 30 3304
盖世英雄少女心
盖世英雄少女心 2020-12-07 10:51

I have some tests that use the built in Microsoft.VisualStudio.TestTools.UnitTesting, but can not get them to run.

I am using visual studio 2012 ultimat

30条回答
  •  生来不讨喜
    2020-12-07 11:12

    I had same issue, but a bit different.

    I was using visual studio 2012. For some reason, only the tests of the initial generated file was running. But tests in another file were not running. Tried out different solutions posted here, did not work.

    Finally I figured out that I had a private method in the test class which was the first method inside the class. I just moved the private method after a test method; so now, a method with [TestMethod] attribute is the first method inside the class. Strange, but now it works.

    Hope this helps someone someday.

提交回复
热议问题