4
shouts

Adding Integration Tests to an ASP.NET MVC Application - Liam McLennan

posted by DustinDustin 352 days, 7 hours, 40 minutes ago
Friday, March 27, 2009 10:53:14 PM GMT

The project I am working on is an Asp.Net MVC application. I wanted to add integration tests that call either controller actions or application services and test the integrated application. To do this I needed to:

  • Automate the process of setting up an integration testing database environment.
  • Duplicate my production IoC solution in such a way that it can be used in tests.
  • Provide an easy way for integration tests to establish a context for the integration tests. This really just means simulating a logged in user.

Automate the Process of Setting Up an Integration Testing Database Environment

We manage our sql server database by keeping two sql scripts in subversion: a schema script and a test data script. Therefore to setup an integration database environment all I had to do was execute the two scripts. Here is the target I had to add to my NAnt build script:

category: ASP.NET | clicked: 0 | | source: hackingon.net | show counter code
tags: ASP.NET, ASP.NET MVC, ASPNETMVC

No comments yet, be the first one to post comment.

To post your comment please login or signup