Skip to content

yln/dryrunner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

DryRunner

DryRunner provides isolated integration testing for ASP.NET. A common problem when doing automated integration testing against ASP.NET websites is that tests can inadvertently modify your local development database, or other files within your development website. DryRunner solves that problem by:

  • deploying a test version of your website to a temporary location,
  • hosting the test version of your website using IIS Express, and
  • cleaning up afterwards by deleting the test version.

DryRunner requires you to create a Test build configuration (alongside the usual Debug, Release and any other build configurations you may already have). You can use Web.Test.config to configure test-specific database connection strings, and other test-specific settings.

Installation

Install the DryRunner package using NuGet.

Configuration

You'll need to setup a couple of things before DryRunner will work:

  1. Install IIS Express on your local development machine (and build server, if you want to use DryRunner there too).
  2. Create a Test build configuration for your website project. Note that you don't need to create a new solution configuration, only a project-level configuration for the website project(s) that you want to test.

Usage

// You'd normally want to do this in a test fixture setup.
string websiteProjectName = "DryRunner.TestWebsite";
int port = 9000; // Any port that won't conflict with other services running on your computer.
string applicationPath = "/blub"; // Application path (optional; default is the server root "/").
TestSiteManager testSiteManager = new TestSiteManager(websiteProjectName, port, applicationPath);
testSiteManager.Start();

// Run your tests and point them to: http://localhost:9000/blub

// You'd normally want to do this in a test fixture teardown.
testSiteManager.Stop();

License

DryRunner is released under the MIT License.

About

Isolated integration testing for ASP.NET

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 99.2%
  • Classic ASP 0.8%