I have a C # solution with the following structure:
mySolution myProject myProject.MSTests References Microsoft.VisualStudio.QualityTools.UnitTestFramework sutMSTests.cs
sutMSTests.cs:
[TestClass()] public class sutMSTests { [TestMethod] public void MyTest0() { Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(4, 2 + 2); } }
When I try to run tests through Test, Run, All Tests In Solution, I get the following in the VS2008 status bar:
No tests are performed because the tests are not loaded or the selected tests do not work.
Test, Windows, Test View does not show any tests.
Note. I created the tests manually (works for xUnit.net) instead of using Microsoft wizards.
I compared my manually created MSTest setup with the setup of another test that I generated using the wizard, and they look pretty similar.
Question: What are the most likely causes of the error message above?
Change 2010-02-25: Additional information:
I right-click the Solution Elements folder and select "Add", "Create Project", "Type of Test Projects", "Test Documents :: Visual Studio Project Template".
The new project does nothing by default, the test "TestMethod1" was detected and transferred.
However, my test did not appear ... so I copied and pasted my test method into the default test test project "TestProject1".
My test was detected in "TestProject", but not in its original location.
I carefully compared the files, organization and settings of "TestProject1" with my manually created test project.
At this point, I assume that some settings are created using the Visual Studio Test Project project template, which is not easy to detect.
imo, it’s as easy to create a test project manually as you can create it using the Visual Studio test project template.
Please note: I am not saying that I am against using the Visual Studio Test project template; for me, I like to understand what's behind the curtain, as that makes me imho a much better programmer.