mardi 5 mai 2015

When to create Unit tests for routes in asp.net MVC application

It make sense to create unit tests for the routes in an asp.net mvc project if we don’t use our services and models like a restfull api? I’m exploring a project that uses the MvcRouteUnitTester (url for the project) and has code like this:

using MvcRouteUnitTester;

[TestClass]
public class RouteTests
{
    [TestMethod]
    public void TestIncomingRoutes()
    {
        var tester = new RouteTester<MvcApplication>();

        tester.WithIncomingRequest("/Foo").ShouldMatchRoute("Foo", "Index");
    }
}

If I always use the helper Url.Action to create links to my foo model, it still makes sense to create this unit tests?

Aucun commentaire:

Enregistrer un commentaire