lundi 25 juillet 2016

Best way to test routes for Web API?

I want to write unit tests to test that routes are able to be called in my routeconfig.cs. What is the best approach to do this?

routes.MapRoute(
            name: "RelativeURL",
            url: "{*relativeURL}",
            defaults: new { controller = "Home", action = "Foo" }
            );

For example how would I test that the above route works via unit tests?

Aucun commentaire:

Enregistrer un commentaire