Why does visual studio 2012 not find my tests?

后端 未结 30 3310
盖世英雄少女心
盖世英雄少女心 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:30

    In my recent experience all of the above did not work. My test method

    public async void ListCaseReplace() { ... }
    

    was not showing up but compiling fine. When I removed the async keyword the test the showed up in the Test Explorer. This is bacause async void is a 'fire-and-forget' method. Make the method async Task and you will get your test back!

    In addition, not having the Test project's configuration set to "Build" will also prevent tests from showing up. Configuration Manager > Check your Test to build.

提交回复
热议问题