Any way to make a normal project behave like a Microsoft Testing project?
I'm currently writing an analysis system within which, in开发者_运维问答 the solution, I have created multiple test projects.
I'm using Visual Studio 2008 Professional with Microsoft.VisualStudio.QualityTools.UnitTesting or the Microsoft Testing tools.
While creating a Test Project using the template, it uses some configuration to enable one to set the test project as the startup project so that when [F5] is pressed, the project test methods are run one after the other, or else, you can even click the Debug in Context button to debug one test at a time.
Having created my test projects normally just as I have done with the others, and referenced the Microsoft.VisualStudio.QualityTools.UnitTesting namespace in my project, plus having project-referenced my project that contains the classes to be tested, I can now not test or run any of the test method I have written.
Is there a way for me to be able to run the tests just I as would have using a test project template?
How to use Microsoft Testing like I would using NUnit, that is, only referencing it and importing its namespace and so forth?
Are there any attributes I have to use somewhere at the assembly level or so to allow me to use my "normal" projects for testing?
Thanks in advance for the kind help! =)
You'll need to manually edit your project file to add a special ProjectTypeGuids element. There's no easier way around it, which is one of the many reasons that MSTest is not particularly well-suited for unit testing.
精彩评论