Created
August 2, 2011 12:00
-
-
Save neiled/1120061 to your computer and use it in GitHub Desktop.
GivenSpecification for Automated Acceptance Testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace IntegrationTestUtils | |
{ | |
public abstract class GivenSpecification | |
{ | |
public TestContext TestContext { get; set; } | |
/// <summary> | |
/// Steps that are run before each test. | |
/// </summary> | |
[TestInitialize] | |
public void TestInitialize() | |
{ | |
Given(); | |
When(); | |
} | |
/// <summary> | |
/// Steps that are run after each test. | |
/// </summary> | |
[TestCleanup] | |
public void TestCleanup() | |
{ | |
Cleanup(); | |
} | |
/// <summary> | |
/// Sets up the environment for a specification context. | |
/// </summary> | |
protected virtual void Given() | |
{ | |
} | |
/// <summary> | |
/// Acts on the context to create the observable condition. | |
/// </summary> | |
protected virtual void When() | |
{ | |
} | |
/// <summary> | |
/// Cleans up the context after the specification is verified. | |
/// </summary> | |
protected virtual void Cleanup() | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment