Skip to content

Category: xunit

Implementing a Teardown Method in XUnit

XUnit is a free open source unit testing tool for .NET written by the original inventor of NUnit v2 which is great to work with and supports .NET Core, however, how it handles clean up is slightly different to other test frameworks you may have used. What is a TearDown Method? If you haven’t done much-automated testing before then you may not know what a TearDown method is. Typically its the method responsible for cleaning up after your test(s) have run. For example, an integration test might create data which is persisted to a database. Afterwards, this needs to be purged of data…