Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which Unit test framework and how to get started (for asp.net mvc)

I'v never done unit testing before, but now I am willing to give it a try.

What framework is best for starters? Pros and Cons

what should i read before i begin any coding? Books/Articles/Code/Blogs

is there any opensource "sample projects"?

I will be usign it with asp.net mvc/C#.

like image 429
Nikita Ignatov Avatar asked Dec 25 '08 20:12

Nikita Ignatov


People also ask

Which framework is used in ASP NET MVC?

The view engines used in the ASP.NET MVC 3 and MVC 4 frameworks are Razor and the Web Forms. Both view engines are part of the MVC 3 framework. By default, the view engine in the MVC framework uses Razor .


2 Answers

If you have integrated Unit Testing in Visual Studio (I think it's part of Professional and better), start with that, because it's integrated. Downside is that to my knowledge, there is no test runner outside of Visual Studio or the Team Foundation Server which disqualifies it for automated testing, but I am not sure how current that information is.

Other alternatives are xUnit.net, NUnit and mbUnit. I can't really talk about the pros/cons due to lack of experience, but I use xUnit.net now because a) I know that there is a working ASP.net MVC Template since Version 1.1 and b) Assert.Throws is just sexy. I use the free personal version of TestDriven.net as my Test Runner within Visual Studio.

There is a "How to get started" Guide for xUnit: http://www.codeplex.com/xunit/Wiki/View.aspx?title=HowToUse

Again, I can't really compare them due to lack of experience with NUnit and mbUnit, but I believe that all three are quite stable and usable.

like image 109
Michael Stum Avatar answered Sep 20 '22 17:09

Michael Stum


Rob Conery has created a serie of videos showing how to create an eCommerce app using MVC. He's using a complete testdriven approach (using the built-in test framework in visual studio 2008)

like image 29
l3dx Avatar answered Sep 18 '22 17:09

l3dx