asp.net mvc - Do you check HttpVerbs in your unit tests? -


Standard ASP. Looking at the unit tests that come with the MVC Web project template I have seen that they do not check whether or not a proper HTVPARS attribute is set to every action method.

It is easy to test this with reflection, but the question is whether it is worth the effort. Do you check HTTPVirbs in your unit test, or do you leave it for unity testing?

You can also use MvcContrib.TestHelper to test route along the route.

  [TestMethod] Public Zero ShouldConfirmRouteForNewObjectWithPost () {"~ / Object / New" .WithMethod (HttpVerbs.Post). ShouldMapTo & lt; ObjectController & gt; (X => x.New ()); }  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -