Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If it just a simple application, the MSTest framework built into VS2008 should tick all the boxes. It is not the same as NUnit, though a lot of people (mistakenly) refer to it as if they were the same thing. </p> <p>I have never used it for mocking, so maybe someone else can elaborate on that. It generates a separate project in your solution that is just for the purpose of testing. <a href="http://www.geekzone.co.nz/vs2008/4819" rel="nofollow noreferrer">This is a good explanation of how to use it.</a></p> <p><img src="https://www.geekzone.co.nz/images/blog/vs2008/unittesting/09.jpg" alt="alt text"></p> <p><strong>Edit:</strong> Doing a bit more digging, I came across <a href="http://www.c-sharpcorner.com/UploadFile/satisharveti/VS2008UnitTesting08132008055534AM/VS2008UnitTesting.aspx" rel="nofollow noreferrer">this comparison</a> of MSTest and NUnit.</p> <p><strong>Drawbacks of NUnit Framework:</strong></p> <ul> <li>Installation of NUnit comes in a separate MSI.</li> <li>No Integration with Visual Studio.</li> <li>Requires writing test cases manually. </li> <li>No auto generation of code.</li> <li>Requires opening separate window (NUnit Console or GUI) to execute test cases.</li> <li>Ordering of test cases execution not available.</li> <li>No inbuilt feature to debug test cases.</li> <li>No inbuilt feature to enable/disable test cases.</li> <li>No inbuilt feature to give additional information of test cases like stack trace, Trace Information etc.</li> <li>No inbuilt feature to sort test cases based on Computer Name, Class Name and Host Type etc.</li> </ul> <p>That's from the comparison article I linked to.</p> <p>I have never used NUnit, only MSTest for C# and JUnit for Java, so I am kind of biased in that respect. MSTest has always worked really well for me <strong>for WinForms</strong>, with features like being able to run the tests individually, show really detailed reports (with individual trace logs) and autogenerate all the boilerplate test code and do all those kind of things that make VS2008 such a brilliant IDE. By the sounds of it, NUnit has worked well for others and they have their reasons why they like it.</p> <p>Unless you have a particular reason to take the NUnit/Testdriven.NET approach, like you need a certain feature, or you just prefer that way of setting up tests and trying to integrate it back into VS, then I don't see any reason not to just use MSTest which works right out of the box. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COSeems unfair when a lot of people use TestDriven.NET to drive NUnit. That provides great integration and removes most of the drawbacks you mention. The NUnit [Ignore] attribute disables [Test] methods or [TestFixture] classes. Also, IMHO ordering test cases is a bit smelly :)
      singulars
    2. COouch. 600 chars is not going to be enough. 1. that's good. I can run my tests on any (build/QA) machine without having to install VSTS. 2. If you want right-click and run tests, get Resharper/TestDriven.Net add-ins. Also see SO q#196740. #3,4,6,10 - doesn't make sense. I believe programmers know their code better than VS. It follows that they can better identify what tests to write. But then I'm test-infected (read TDD zealot). test cases should not be order dependent - so not sure why that is a disadvantage.
      singulars
    3. COContd... Debugging test cases can be done (add nunit as external exe to debug for your test dll) ; although that it implies that you don't know your code anymore. Sorting test cases - again not sure why you need it. But you could group your tests into categories like [Category("Slow Tests")] and then include or exclude them from test runs. You also have a checkbox view where you can manually tick tests you'd like to run. Finally 9. stacktrace - nunit does that in the first tab. A unit testing framework would be kinda crippled if it didnt point to the exact location where the test failed!
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload