Mid
From PDF
Testing
Unit Testing
How do you use the [TestInitialize] and [TestCleanup]
ttributes?
- [TestInitialize] runs code before each test method to set up prerequisites.
- [TestCleanup] runs after each test method to clean up resources.
[TestInitialize]
public void Setup() { /* setup code */ }
[TestCleanup]
public void Cleanup() { /* cleanup code */ }Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png