Last active
January 10, 2018 15:59
-
-
Save tdshipley/c75579a87b78c2f6d848f6fcdf31a5e1 to your computer and use it in GitHub Desktop.
Using IDisposable to clean up a test
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
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