In the companyNunitBut it is not easy to use because vs testing is found.CodeAutomatically generated. So we roughly comparedVisual StudioBuilt-inUnit TestAndNunit.
InStackoverflowSomeone has discussed this issue. The following entries are extracted from each webpage. Make a summary for your reference.
On the surface, different class libraries are used. This problem is well solved by a macro.
# If! Nunit
Using Microsoft. visualstudio. testtools. unittesting;
# Else
Using nunit. Framework;
Using testclass = nunit. Framework. testfixtureattribute;
Using testmethod = nunit. Framework. testattribute;
Using testinitialize = nunit. Framework. setupattribute;
Using testcleanup = nunit. Framework. teardownattribute;
Using testcontext = system. String;
Using deploymentitem = nunit. Framework. descriptionattribute;
# Endif
NunitThere are several advantages
1.Independent fromIDE, Which can be run independently. You can also run the command line. (VSShould it be OK ?)
2.Quick version updates. (I don't think this is an advantage, and I don't think it's quick .)
3.VSOfUTThe tool runs slowly. (Not necessarily)
NuiteThere are also several shortcomings
1.Not SupportedDebugTo installTestdriven. net.
2.You cannot view code coverage.Ncover. WhileVSCode coverage is very clear.
3.The test code cannot be automatically generated.CodesmithIt is better to use it together, but it will be charged later.
Note: The XML generated by ncover is too large, and crash is triggered when IE is not moved (ncoverexplorer is better, but the company does not ......). After searching for half a day today, I have not found any command line parameter for ncover to generate only data of a specific namespace. Finally, I changed the XSL to not display the method-level XML, which is better.
Vs UTBiggest drawback-price! OnlyVs proOnly supportedUT, OnlyVstsCode coverage is supported.
Some people think thatVsutRelatively difficultCc. netIntegration. Although I did not tryCCDirectly useVsutBut it should be okay.
Let's take a look.VS.
|
With premium msdn |
With professional msdn |
Without msdn |
Vs 2008 team system |
$10939 |
|
|
Vs 2008 professional |
$2499 |
$1199 |
$799 |
V. S. 2008 Standard |
|
|
$299 |
For the latest quotation, refer:Http://msdn.microsoft.com/en-us/aa700832.aspx
In addition, resharper(30Day Trial ),Xunit(Open Source ),MbunitBothUTA good choice.
Refer:Http://stackoverflow.com/questions/92869/nunit-vs-visual-studio-2008s-test-projects-for-unit-testing
Http://stackoverflow.com/questions/709/net-testing-framework-advice
Http://stackoverflow.com/questions/1760/net-unit-testing-packages