I am very new to unit testing. I have been following the procedures for creating a unit test in visual studio 2012 on http://channel9.msdn.com/Events/TechEd/Europe/2012/DEV214.
The test just won't start. And it will prompt me "A project with an Output Type of Class Library cannot be started directly.
In order to debug this project, add an executable project to this solution which references the library project. Set an executable project as the startup project.
Even though I attached the unit test class code to a console program, the test does not start and the test explorer is empty. In the video, it doesn't need to have any running program. The lady only created a class library, and the test will run.
what should I do? Note. there is no "create unit test" on the mouse right click menu
I found out the reason why. I have to go to Visual Studio Gallary and download xUnit.net runner and the tests will get into my test explorer. Just getting the library from Nuget won't do the work.
The runner found in Visual Studio Gallary is no longer supported. You should use the NuGet packages:
Install-Package xunit.runner.visualstudio
Install-Package xunit.runner.msbuild
Install-Package xunit.runner.console
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With