Question

I was wondering if people test the gui part of their MVC .NET based web services. I have used Watin / Specflow. I have two main concerns with this:

  1. These test more than just the gui. They are system checks. They test the db and the business logic. Any big change to the gui would mean these tests would have to be re-written. The gui also here depends on how the backend works.
  2. The tests take are very slow. The front-end designer/coder cant work in a TDD fashion if these tests take time.

Is there a way to simply test the cshtml templates alone? Passing in a fake ViewBag for example, and seeing whether the output of the cshtml uses the correct values etc. And how fast would they run?

Thanks!

Était-ce utile?

La solution

Is there a way to simply test the cshtml templates alone? Passing in a fake ViewBag for example, and seeing whether the output of the cshtml uses the correct values etc.

Yes, you may take a look at RazorEngine.

And how fast would they run?

Go measure. But it is certain that it will be faster than a full HTTP request to an actually deployed application.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top