Why does visual studio 2012 not find my tests?

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

    This sometimes works.

    Check that the processor architecture under Test menu matches the one you use to build the solution.

    Test -> Test Settings -> Default Processor Architecture -> x86 / x64

    As mentioned in other posts, make sure you have the Test Explorer window open. Test -> Windows -> Test Explorer

    Then rebuilding the project with the tests should make the tests appear in Test Explorer.

    Edit: As Ourjamie pointed out below, doing a clean build may also help. In addition to that, here is one more thing I encountered:

    The "Build" checkbox was unticked in Configuration Manager for a new test project I had created under the solution.

    Go to Build -> Configuration Manager. Make sure your test project has build checkbox checked for all solution configurations and solution platforms.

提交回复
热议问题