DI Containers in NUnit Tests
summary
The talk examines using dependency-injection (DI) containers inside NUnit tests to address common test-code issues: hard-to-read and hard-to-refactor test code, lack of parallelizability, expensive shared setup, and confusing test context caused by SetUp methods and inheritance. It demonstrates applying standard coding and DI practices to improve test readability, enable parallel execution, reduce unnecessary preparation work, and clarify each test’s execution context.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:26About the talk
- 2:31Unit testing practices
- 10:01Setup attribute problems
- 13:31Test code best practices
- 15:41Fixing setup attributes
- 19:21Inheritance to delegation
- 21:28DI containers in tests
- 25:20Refactoring tests
- 32:52Advanced DI features
- 35:25Pitfalls and tips
- 39:22Pros and cons
- 40:49xUnit comparison
- 44:46Q&A
