<p>I'm looking to add a testing suite to my application, however I can't move to the newer testing frameworks for .NET 3.5. </p>

<p>Does anyone have a suggestion about good testing frameworks to use?</p>

[{'answer_id': 2220, 'author': 'Nick Berardi', 'author_id': 17, 'author_profile': 'https://Stackoverflow.com/users/17', 'pm_score': 2, 'selected': False, 'text': '<p>NUnit is always a favorite of mine.  However if you are using TFS as your source control I suggest you stick with the Microsoft Stack.</p>\n'}, {'answer_id': 2228, 'author': 'Rytmis', 'author_id': 266, 'author_profile': 'https://Stackoverflow.com/users/266', 'pm_score': 2, 'selected': False, 'text': '<p>For a Mock Object library, I\'ve found the BSD-licensed <a href="http://ayende.com/projects/rhino-mocks.aspx" rel="nofollow noreferrer">Rhino.Mocks</a> to be rather pleasing.</p>\n'}, {'answer_id': 2246, 'author': 'Ronnie', 'author_id': 193, 'author_profile': 'https://Stackoverflow.com/users/193', 'pm_score': 2, 'selected': False, 'text': '<p><strong>NUnit</strong> is available at <a href="http://www.nunit.org" rel="nofollow noreferrer">http://www.nunit.org</a>\nI would suggest this even when working on the MS stack - the support for non-MS frameworks is happening in the MVC previews which shows a definite movement in the right direction to allow us all to customise our stacks to fit.</p>\n'}, {'answer_id': 3423, 'author': 'Jason Sparks', 'author_id': 512, 'author_profile': 'https://Stackoverflow.com/users/512', 'pm_score': 2, 'selected': False, 'text': '<p>I\'ve had great success using <a href="http://www.nunit.org" rel="nofollow noreferrer">NUnit</a> as well.</p>\n\n<p>I\'ve also used <a href="http://www.nmock.org" rel="nofollow noreferrer">NMock</a> when the need arose for mock objects. As an added bonus, the factory for creating your mock objects is called the Mockery.</p>\n\n<p>To facilitate the running of unit tests, I\'ve used <a href="http://testdriven.net" rel="nofollow noreferrer">TestDriven.NET</a> to run unit tests as I coded. Also, I\'ve used <a href="http://ccnet.thoughtworks.com" rel="nofollow noreferrer">Cruise Control .NET</a> to watch SVN and check that every new commit builds and passes all unit tests.</p>\n'}, {'answer_id': 3443, 'author': 'Dan', 'author_id': 230, 'author_profile': 'https://Stackoverflow.com/users/230', 'pm_score': 4, 'selected': True, 'text': '<p>We use <a href="http://www.mbunit.com/" rel="noreferrer">MbUnit</a> and <a href="http://www.ayende.com/Blog/archive/2007/03/28/Rhino-Mocks-3.0-Released.aspx" rel="noreferrer">Rihno Mocks</a> and they prove to work very well together. When doing TDD you will almost certainly need to do some form of dependency injection, while this can be done manually, its worth looking at an IoC container such as <a href="http://www.castleproject.org/projects/windsor/" rel="noreferrer">Castle Windsor</a>.</p>\n\n<p>It well worth looking at John Paul Bodhood\'s screen casts to get you started. <a href="http://www.jpboodhoo.com/" rel="noreferrer">JPB\'s Blog</a></p>\n'}, {'answer_id': 48405, 'author': 'fuzzbone', 'author_id': 5027, 'author_profile': 'https://Stackoverflow.com/users/5027', 'pm_score': 2, 'selected': False, 'text': '<p>Using nUnit with TFS isn\'t too difficult.  There\'s even a project on codeplex to implement this: <a href="http://www.codeplex.com/nunit4teambuild" rel="nofollow noreferrer">NUnit for Team Build</a> which even "publishes" the results to the warehouse.</p>\n\n<p>I haven\'t tried it - but I would advise clients who have a large investment (or who have a strong preference for it over the MSTest tool) in nUnit who are interested in implementing TFS to continue with nUnit as opposed to trying convert all their existing tests.</p>\n'}, {'answer_id': 58587, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 3, 'selected': False, 'text': '<p>NUnit and Rhino suit well and the <a href="http://www.ayende.com/Blog/archive/2007/06/08/The-Auto-Mocking-Container.aspx" rel="noreferrer">auto-mocking container</a> might be of interest.</p>\n\n<p>If you\'re looking at BDD too then <a href="http://nbehave.org/" rel="noreferrer">NBehave</a> is probably a good choice. If however you just mean the style of BDD that relates to unit testing (xSpec) though you can get away with adding a framework (though things like <a href="http://code.google.com/p/specunit-net/" rel="noreferrer">specunit</a> do add some synctactic sugar), but you might want to look at <a href="http://codebetter.com/blogs/aaron.jensen/archive/2008/05/08/introducing-machine-specifications-or-mspec-for-short.aspx" rel="noreferrer">MSpec</a> is also interesting.</p>\n'}, {'answer_id': 142982, 'author': 'smaclell', 'author_id': 22914, 'author_profile': 'https://Stackoverflow.com/users/22914', 'pm_score': 2, 'selected': False, 'text': '<p>I have to put a shout-out for <a href="http://code.google.com/p/moq/" rel="nofollow noreferrer" title="This is the project site, check it out">Moq</a>. It is a clean light mocking framework that guides you into the pit of success.</p>\n<p>The testing tools built into TFS are okay. They will get the job done but can often be a little cumbersome to work with. The generated reports, code coverage and a few other portions are particularly bad. They make you go bald at 22 rather than 50.</p>\n<p>If you are really loving the testing, consider trying some Continuous Integration. You will feel the pain from regression quickly and this pain potentially helps you get to the end goal faster.</p>\n<p>Regardless of what you do, try out a few and see which one is the most natural, if you have time. Good luck and happy coding.</p>\n'}, {'answer_id': 192489, 'author': 'Michael Mann', 'author_id': 48146, 'author_profile': 'https://Stackoverflow.com/users/48146', 'pm_score': 2, 'selected': False, 'text': '<p>This is probably a summary of what has already been said, but for TDD I personally use Rhino Mocks and MBUnit.  Rhino Mocks is a mocking framework that is free and open source.  The advantage of Rhino Mocks is we do not need to use magic strings in setting your expectations as you do in NMock.  </p>\n\n<p>I like MBUnit because MbUnit has the concept of RowTests which allow you to vary your inputs to your test method.  MBUnit is also freely available.</p>\n\n<p>You also want to make sure that whatever you choose for your unit testing framework is supported by your CI (Continuous Integration Server).  Nunit is supported by default in Cruise Control.NET and you have to do a little extra work to get MBUnit to work in ccnet.</p>\n\n<p>From an IDE standpoint you must have TestDriven.NET.  TestDriven.NET allows you to right click and run tests in the IDE and it supports MBUnit and Nunit and others.</p>\n\n<p>NBehave is the BDD library I have used.  I have not used any others so I could not compare and contrast them with you, but NBehave is supported by Gallio from the MBUnit team, which means you can run your BDD tests just as you would your unit tests with TestDriven.NET.</p>\n\n<p>I would also highly recommend Resharper.  You will find your productivity increase significantly with this refactoring and guidance tool.  It will assist you with changing your code as you are developing your tests.</p>\n\n<p>Hope this helps</p>\n'}, {'answer_id': 204909, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>I recommend the following:</p>\n\n<p><strong>TestDriven.NET</strong> - Unit Testing add on for VS that is fully integrated with all major unit testing frameworks including NUnit, MbUnit etc...</p>\n\n<p><strong>Typemock Isolator</strong>- A mocking framework for <a href="http://www.typemock.com/Docs/writing_unit_tests_with_isolator.html" rel="nofollow noreferrer">.Net Unit Testing</a></p>\n\n<p><strong><a href="http://www.nunit.org" rel="nofollow noreferrer">NUnit</a></strong> - An open source unit testing framework that is in C#.</p>\n'}, {'answer_id': 1006681, 'author': 'mcintyre321', 'author_id': 2086, 'author_profile': 'https://Stackoverflow.com/users/2086', 'pm_score': 3, 'selected': False, 'text': '<p>Check out Rob Conery\'s screencast on BDD using MSpec. Very impressive <a href="http://blog.wekeroad.com/mvc-storefront/kona-3/" rel="nofollow noreferrer">http://blog.wekeroad.com/mvc-storefront/kona-3/</a></p>\n\n<p>edit: I now use this approach: <a href="http://10printhello.com/the-one-bdd-framework-to-rule-them/" rel="nofollow noreferrer">http://10printhello.com/the-one-bdd-framework-to-rule-them/</a></p>\n'}, {'answer_id': 1006810, 'author': 'Michaël Larouche', 'author_id': 121981, 'author_profile': 'https://Stackoverflow.com/users/121981', 'pm_score': 2, 'selected': False, 'text': '<p>For my project, I used NUnit and TestDriven.NET with great success. You can either create a separate library just to host your test code or put it in your executable or library. It all depends on whether you want your production code to be intertwined with your test code.</p>\n<p>For Dependency Injection, I use <a href="http://www.ninject.org/" rel="nofollow noreferrer" title="NInject">NInject</a> in my current project and it works great. If you use Constructor injection, you don\'t need to clutter your code with the [Inject] attribute.</p>\n<p>I haven\'t used a mock library for my .NET 2.0 project but for another .NET 3.5 project I will use <a href="http://code.google.com/p/moq/" rel="nofollow noreferrer" title="Moq">Moq</a>.</p>\n<p>Note that all these work with .NET 2.0 and higher. (except Moq)</p>\n'}]
['https://Stackoverflow.com/questions/2214', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/395/']