<p>I've read time and time again that TDD/test first is more difficult with MSTest than it is with other testing frameworks such as nUnit, MBUnit, etc... What are some suggested manual workarounds and/or 3rd party bits that you suggest when MSTest is the only option due to infrastructure policy? I'm mainly wondering about VS 2008 Team Suite, but I suppose tips for VS 2008 Pro on up would be suitable too since some MSTest functionality is now included with those versions as well.</p>

[{'answer_id': 29563, 'author': 'Sander', 'author_id': 2928, 'author_profile': 'https://Stackoverflow.com/users/2928', 'pm_score': 2, 'selected': False, 'text': '<p>I have not seen any serious issues with MSTest. What, specifically, are you talking about? We are, in fact, moving away from NUnit to MSTest. I do not know our reasons for this, though.</p>\n'}, {'answer_id': 29568, 'author': 'DevelopingChris', 'author_id': 1220, 'author_profile': 'https://Stackoverflow.com/users/1220', 'pm_score': 2, 'selected': False, 'text': '<p>There are lots of config files with mstest, making it less condusive.<br>\nAnother reason I chose mbunit, is the "rollback" feature of mbunit. This allows you to rollback all database things done in this test, so you can actually do full circuit tests and not worry about the pond being tainted after the test.<br>\nAlso lack of RowTest facilities in mstest.</p>\n\n<p>I suggest just running mbunit as a dependency inside the build process, its easy enough to just float it with your bin, and reference, no installation required.</p>\n'}, {'answer_id': 29603, 'author': 'Haacked', 'author_id': 598, 'author_profile': 'https://Stackoverflow.com/users/598', 'pm_score': 4, 'selected': False, 'text': "<p>If you have no choice but to use MSTest, learn the keyboard shortcuts. They'll make your life a little easier.</p>\n\n<p>Test in Current Context: <kbd>CTRL</kbd>+<kbd>R</kbd>, <kbd>T</kbd><br>\nAll Tests in Solution:   <kbd>CTRL</kbd>+<kbd>R</kbd>, <kbd>A</kbd></p>\n\n<p>Debug Tests in Current Context: <kbd>CTRL</kbd>+<kbd>R</kbd>, <kbd>CTRL</kbd>+<kbd>T</kbd><br>\nDebug All Tests in Solution:    <kbd>CTRL</kbd>+<kbd>R</kbd>, <kbd>CTRL</kbd>+<kbd>A</kbd></p>\n"}, {'answer_id': 29617, 'author': 'Gishu', 'author_id': 1695, 'author_profile': 'https://Stackoverflow.com/users/1695', 'pm_score': 1, 'selected': False, 'text': '<p>To answer a non-pointed question, my answer would be \n"probably NUnit just stays out of your face."</p>\n\n<p><strong>Disclaimer</strong>: I\'ve no actual experience with MS version of xUnit, however I hear problems like \'You need to install the gigantic idea just to run your tests on a separate machine\' - which is a complete No-No.\nOther than that MS has this way of contorting the right path for a newbie via some kind of IDE bell/whistle that runs counter to the whole idea. Like generating tests from classes was one I remember from a year or so back.. that defeats the whole point of <em>test-driving</em> - your design is supposed to emerge from tiny steps of RGR: writing a test-make it pass-refactor. If you use that tool - it robs you of the entire experience. </p>\n\n<p>I\'ll stop with my sermon.. now :)</p>\n'}, {'answer_id': 30700, 'author': 'Brad Tutterow', 'author_id': 308, 'author_profile': 'https://Stackoverflow.com/users/308', 'pm_score': 6, 'selected': True, 'text': '<p>MSTest is certainly not as efficient or extensible as some of the open source frameworks, but it is workable.  Since the question asks about making life easier with MSTest and not about alternatives, here are my MSTest tips.</p>\n\n<ul>\n<li><strong>Shortcuts</strong>.  Like Haacked said, take a few seconds to learn the shortcuts.</li>\n<li><strong>Current Context</strong>.  Since MSTest is so slow, run tests only in the current context when you can.  (<strong><kbd>CTRL</kbd>+<kbd>R</kbd></strong>, <strong><kbd>CTRL</kbd>+<kbd>T</kbd></strong>).  If your cursor is in a test method, this will only run the method.  If your cursor is outside a method, but in a test class, this will only run the test.  And with namespace, etc etc</li>\n<li><strong>Efficient tests and organization</strong>.  It\'s dog slow.  Make things as best as you can by writing efficient tests.  Move slow tests to other test classes or projects so you can run the fast tests more frequently.</li>\n<li><strong>Testing with WCF</strong>.  If you\'re testing services, be sure to DEBUG tests rather than RUN tests so Visual Studio can fire up the ASP.NET development web servers.  After these are up, then you can go back to RUN, but it can be easier to just always DEBUG so you don\'t have to think about it.</li>\n<li><strong>Config Files</strong>.  Edit your test-run configuration to move .config files into the test execution folder.</li>\n<li><strong>Integration with Source Safe</strong>.  You need to be aware that MSTest hates SourceSafe and the feeling is mutual.  Because MSTest wants to put test files under source control, and add them to the solution, it must check out the solution every time you run tests.  So SourceSafe must be running in multi-check-out mode to avoid killing your fellow developers.</li>\n<li><strong>Ignore the fluff</strong> With MSTest, you get a dozen different windows and views. Test Runs, Test View, Test Lists ... they\'re all less-than-helpful.  Stick with Test Results and you\'ll be much happier. </li>\n<li><strong>Stick with "Unit Tests"</strong>.  When you add a new test, you can add an ordered test, a unit test, or run through a wizard.  Stick with just plain simple unit tests.</li>\n</ul>\n'}, {'answer_id': 73645, 'author': 'Iain Holder', 'author_id': 1122, 'author_profile': 'https://Stackoverflow.com/users/1122', 'pm_score': 2, 'selected': False, 'text': '<p>My colleague Mike Hadlow has pretty good summary of why we utterly loath MSTest <a href="http://mikehadlow.blogspot.com/2008/07/mstest-is-sapping-my-will-to-live.html" rel="nofollow noreferrer">here</a>.</p>\n<p>He\'s managed to remove it from his project, but I\'m currently working on a larger project with more politics involved so we\'re still using it.</p>\n<p>The upshot of it is that whoever implemented MSTest doesn\'t understand TDD.  I\'m sorry to sound like an M$ basher - I\'m really not.  But I\'m annoyed that I\'m having to put up with a very poor tool.</p>\n'}, {'answer_id': 152516, 'author': 'RhysC', 'author_id': 17466, 'author_profile': 'https://Stackoverflow.com/users/17466', 'pm_score': 2, 'selected': False, 'text': '<ul>\n<li>MSTest has "high friction": Getting\na build script with NAant and MbUnit\ncompared to MStest and MSBuild. No\nComparison. </li>\n<li>MSTest is Slow MbUnit\nand NUnit are in my experince faster\n(gallio may help here)</li>\n<li>MStest adds a\nbunch of stuff i dont need like\nwired config files etc.</li>\n<li>MSTest doesnt have the fetaure set of other OS test frameworks. check out xUnit and MbUnit</li>\n</ul>\n\n<p>It just too hard to use and there are many better options.</p>\n'}, {'answer_id': 211475, 'author': 'Vyas Bharghava', 'author_id': 28413, 'author_profile': 'https://Stackoverflow.com/users/28413', 'pm_score': 3, 'selected': False, 'text': "<p>I'm curious here.  What I don't understand is that people start comparing all Open Source tools available with MSTest and start bashing it.  Commenting on how unwieldy it is, how unintiuitve etc.  IMHO, it's because it's fundamentally different from xUnit frameworks.  It's optimized for parallel execution.</p>\n\n<p>Even the qurik of having static ClassInitialze and Cleanup and having unique TestContext for each of the tests all because of the nextgen - at least for Windows business programmers in MS languages - parallel progarmming concepts.</p>\n\n<p>I had the misfortune of working in a project with tens of thousands of unit tests.  They used to take virtually most of the build time!  With MSTest, we cut that down to very managable timelines.</p>\n"}, {'answer_id': 797663, 'author': 'Fredrik Bonde', 'author_id': 45187, 'author_profile': 'https://Stackoverflow.com/users/45187', 'pm_score': 2, 'selected': False, 'text': "<p>as mentioned oyu need to install the full IDE in order to use MSTest on another machine, which is a bit crap. I suppose this is because they want to make sure that unit tests only works on the higher end visual studios and you sholdné be able to run them in any other way.</p>\n\n<p>ALso, MSTest is quite slow, this is because inbetween each test it rebuilds the entire context for each test, this makes o0ne sure that a former test - failed or otherwise doen't infuence the  current test, but slows things down. you can however use the /noisolation flag, which will run all tests within the MSTest process - which is quicker.\nTo speed up in IDE: In the VS ide you can go to Tools-Options then select Test Tools. Select sub-item called Test execution and in dialouge to the right make sure the check box called 'Keep test execution engine running between test runs' is checked.</p>\n"}, {'answer_id': 3090804, 'author': 'Andrew Conn', 'author_id': 338866, 'author_profile': 'https://Stackoverflow.com/users/338866', 'pm_score': 1, 'selected': False, 'text': "<p>I've done TDD development using NUnit for a number of years and have been using MSTest for about 4 months now due to a role change.</p>\n\n<p>I don't think that MSTest stops someone from doing TDD.  You still have all the core things you need for TDD such as basic asserts and mocking frameworks (I use Rhino Mocks).</p>\n\n<p>MSTest does integrate closely with Visual Studio, the best component of this integration is the Code Coverage Tool that is built in.</p>\n\n<p>BUT\nThere are a number of compelling reasons <strong>not</strong> to use MSTest.  The two biggest turn offs in my opinion are:</p>\n\n<ol>\n<li>The lack of assert options (compared to NUnit)</li>\n<li>The sluggish test runner (slow compared to NUnit)</li>\n</ol>\n\n<p>This means that writing asserts takes more code in combination with a slow test runner means that the whole process is slower than NUnit.\nThe open source options also have a lot more support in the community.</p>\n\n<p>If you are using TFS for CI, then you will need to jump through a few hoops/hacks to get NUnit to publish test results.  Running tests on TFS with MSTest in comparison is very easy and straight forward.\nIf you don't touch TFS than I'd go NUnit all the way, it's just nicer.</p>\n"}]
['https://Stackoverflow.com/questions/29557', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1644/']