Skip to content

Instantly share code, notes, and snippets.

@GeorgeDellinger
Last active December 16, 2015 02:39
Show Gist options
  • Select an option

  • Save GeorgeDellinger/5363936 to your computer and use it in GitHub Desktop.

Select an option

Save GeorgeDellinger/5363936 to your computer and use it in GitHub Desktop.
ContextSpecification File Template
namespace $NAMESPACE$
{
/// <summary>
/// Base class for BDD-style tests.
/// </summary>
/// <remarks>
/// Taken from: http://blogs.msdn.com/b/elee/archive/2009/01/20/bdd-with-mstest.aspx
/// See also: http://dannorth.net/introducing-bdd/
/// </remarks>
public abstract class ContextSpecification
{
public TestContext TestContext { get; set; }
[TestInitialize]
public void TestInitizlize()
{
Context();
BecauseOf();
}
[TestCleanup]
public void TestCleanup()
{
Cleanup();
}
protected virtual void Context()
{
}
protected virtual void BecauseOf()
{
}
protected virtual void Cleanup()
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment