Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Testing a web application is a pretty big topic, but lets keep it simple:</p> <p>To correctly test your application, you have to design the application in a way </p> <ul> <li>that all business logic can be tested via normal unit tests</li> <li>all data access can be abstracted and mocked</li> <li>data access can be integration tested separately</li> </ul> <p>If you have a MVC website, you usually should have all business logic separated from any UI. This should actually enable you to use standard unit test projects to test lets say 80% of your code. Of cause you have to write a lot of code to test it right...</p> <p>If you have tons of business logic in your view, this will result in very hard to test code. The only way to do it (I know about) is automated UI testing. To do this, there are some useful frameworks available, also visual studio offers some tools to automate tests.</p> <p>In general it works like this, you define actions you usually would do as a user in a web browser. All actions the user would do can potentially be tested by scripting it. To do this, it highly depends on how complex and/or dynamic your UI actually is. The more fancy stuff you have, the harder it will get to write a test script...</p> <p>Following are some great articles about automation testing: <a href="http://visualstudiomagazine.com/Articles/2012/12/01/Automated-UI-Testing.aspx" rel="nofollow">http://visualstudiomagazine.com/Articles/2012/12/01/Automated-UI-Testing.aspx</a></p> <p><a href="http://blog.typemock.com/2012/05/22/automated-testing-of-asp-net-mvc-applications" rel="nofollow">http://blog.typemock.com/2012/05/22/automated-testing-of-asp-net-mvc-applications</a></p> <p>here is also a quick video about how to get automated UI tests running in VS2012: <a href="http://channel9.msdn.com/Events/Visual-Studio/Visual-Studio-2012-Virtual-Launch/Automated-UI-testing-with-Visual-Studio-2012" rel="nofollow">http://channel9.msdn.com/Events/Visual-Studio/Visual-Studio-2012-Virtual-Launch/Automated-UI-testing-with-Visual-Studio-2012</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload