开发者

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.

  1. Is there a way for me to be able to run the tests just I as would have using a test project template?

  2. How to use Microsoft Testing like I would using NUnit, that is, only referencing it and importing its namespace and so forth?

  3. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜