7

Closed

Add Unit Tests, Switch To TDD

description

We should wait until the next release on this, as it has been mentioned that unit testing will be dramatically simplified. That said, we still have two questions open:
 
What unit testing framework?
 
What mocking framework?
Closed Aug 7, 2009 at 2:33 PM by TroyGoode
The latest release was written using TDD (xUnit & Moq).

comments

TroyGoode wrote Apr 4, 2008 at 7:17 PM

My suggestions: use MSTest for the unit testing framework, as it has the widest deployment (everyone with VS 2008) and use Moq from mocking, since it seems really cool. =)

Moq: http://code.google.com/p/moq/

maartenba wrote Apr 5, 2008 at 1:22 PM

In favor!

wrote Apr 10, 2008 at 2:56 AM

purekrome wrote Apr 10, 2008 at 2:56 AM

+1 for MSTest

I'm unfamiliar with any mocking tools, right now.

TATWORTH wrote Apr 14, 2008 at 11:29 AM

For the Utilities and Data Layer the aim should be for Unit Testing of all functions. For this I would recommend NUnit as it can be used by VS2008 Express, VS2008 Pro and VS2008 Team (at least it should be for team). I am unfamiliar with MSTest.
For the business layer, what so far I can envisage should also be unit tested. To allow the GUI to be tested, NUNitASP should be used. I am very reluctant to use any tool using Java.

The naming of the test projects should be such that a Team version of unit test project can be added at a later data (perhaps by having UtilityTeam instead of UtilityFixture)

Personal update - I am in the process of moving data from my laptop, to make space to install VS2008 Pro, hence it will be awhile before I am operational.

TATWORTH wrote Apr 15, 2008 at 11:11 AM

For the Utilities and Data Layer the aim should be for Unit Testing of all functions. For this I would recommend NUnit as it can be used by VS2008 Express, VS2008 Pro and VS2008 Team (at least it should be for team). I am unfamiliar with MSTest.
For the business layer, what so far I can envisage should also be unit tested. To allow the GUI to be tested, NUNitASP should be used. I am very reluctant to use any tool using Java.

The naming of the test projects should be such that a Team version of unit test project can be added at a later data (perhaps by having UtilityTeam instead of UtilityFixture)

Personal update - I have installed VS2008 Pro, hence the delay in my responses.

wrote Apr 15, 2008 at 11:12 AM

TATWORTH wrote Apr 22, 2008 at 11:18 AM

Has anyone used partcover from http://sourceforge.net/projects/partcover/ - it is an alternative to NCover which is no longer open source. It should allow the code coverage of all the unit tests on class projects to be measured.

purekrome wrote Apr 23, 2008 at 8:44 AM

Just go MSTest + Moq.

MSTest - built into vs2008. done.
Moq - that's the framework which the ASP.NET MVC developers are using and will be available as proof, with Preview 3 ... very soon. Lets keep it simple, folks.

wrote Apr 25, 2008 at 11:08 PM

BennyXNO wrote Apr 25, 2008 at 11:09 PM

MsTest and Moq

wrote Apr 26, 2008 at 5:47 PM

TroyGoode wrote May 5, 2008 at 4:18 PM

Well, even though MSTest has gotten the most votes AND I originally suggested using MSTest as well... I'm strongly considering using XUnit after having used it for the past few weeks on another project. By changing the MSBuild script to run the tests on build, you don't have dependency on any external tools and everything should work in VS Express as well...

Oh and I love Moq now, so no way I'm using anything but Moq. =)

Thoughts?

wrote May 31, 2008 at 7:34 AM

TroyGoode wrote Jun 7, 2008 at 11:06 PM

Moving this out to a release after the next, since I would like to get a release that works with Preview 3 out ASAP. Maarten has done most (possibly all) the work needed for the Preview 3 release already, so that should be forthcoming soon enough.

wrote Jun 7, 2008 at 11:06 PM

wrote Aug 13, 2008 at 7:07 PM

wrote Feb 7, 2009 at 6:36 PM

wrote Feb 15, 2009 at 2:38 AM

wrote Aug 7, 2009 at 2:33 PM

wrote Aug 18, 2009 at 3:04 AM

wrote Feb 14, 2013 at 7:12 PM

wrote May 16, 2013 at 9:02 AM