Skip to content

Instantly share code, notes, and snippets.

@mhinze
Created January 14, 2013 14:40
Show Gist options
  • Save mhinze/4530502 to your computer and use it in GitHub Desktop.
Save mhinze/4530502 to your computer and use it in GitHub Desktop.
A template for "test case path per fixture" test organization pattern from http://xunitpatterns.com/Testcase%20Class%20per%20Fixture.html
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Should;
namespace $NAMESPACE$
{
[TestClass]
public class TestCaseClassPerFixtureTemplate
{
public static string actual;
[ClassInitialize]
public static void When_some_context(TestContext unused)
{
actual = "Set up and invoke behavior under test";
}
// one logical assertion per test method
[TestMethod]
public void Should_make_asserion_1()
{
actual.ShouldNotBeNull();
}
[TestMethod]
public void Should_make_assertion_2()
{
actual.ShouldStartWith("Set up");
}
// etc.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment