Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using IDisposable to clean up a test
public class TruthTests : IDisposable
{
public TruthTests()
{
}
public void Dispose()
{
//Do cleanup actions here
//
// e.g.
//
// var database = new Database();
// database.reset();
}
[Fact]
public void TrueEqualsTrue()
{
Assert.Equal(true, true);
}
[Fact]
public void TrueDoesNotEqualFalse()
{
Assert.NotEqual(true, false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment