Wednesday, August 24, 2016

Unit Testing ASP.NET MVC

If you have ever had to write a Unit Test for your ASP.NET MVC Web Application, you may quickly discover that writing Unit Tests for ASP.NET MVC for all but the most basic scenarios is quite difficult!

This is because Unit Tests, by default, do not understand how to test the various conventions used in ASP.NET MVC for routing to Views etc.

So how exactly do you solve this dilemma?

Well, thankfully, there is a NuGet package that allows you to fill in the gaps left by the Unit Testing framework!  The name of this NuGet package is TestStack.FluentMVCTesting:

Here is a list of some of the basic types of statements you can include in your MVC Unit Tests using TestStack.FluentMVCTesting:

No comments:

Post a Comment