Skip to content

Instantly share code, notes, and snippets.

@tdshipley
Last active February 5, 2016 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdshipley/edabf4b7ff690e420e26 to your computer and use it in GitHub Desktop.
Save tdshipley/edabf4b7ff690e420e26 to your computer and use it in GitHub Desktop.
An example of why using a Setup and Teardown method in tests can be bad from: http://jamesnewkirk.typepad.com/posts/2007/09/why-you-should-.html
[TestFixture]
public class MyTests
{
[SetUp]
public void BeforeTest()
{
Console.WriteLine("BeforeTest");
}
[TearDown]
public void AfterTest()
{
Console.WriteLine("AfterTest");
}
[Test]
public void Test1()
{
Console.WriteLine("Test1");
}
[Test]
public void Test2()
{
Console.WriteLine("Test2");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment