☄️ Master the Modular Monolith Architecture: https://bit.ly/3SXlzSt
📌 Accelerate your Clean Architecture skills: https://bit.ly/3PupkOJ
🚀 Support me on Patreon to access the source code: https://www.patreon.com/milanjovanovic
In this video, I will show you how to unit-test your application uses. Unit testing the use cases shouldn't be complex. Granted, you implement the use cases using DI and other best practices. I'm going to use NSubstitute to create mocks during unit testing. And I'll use FluentAssertion to write the assertions. You'll see how to get 100% code coverage in your use case methods.
Join my weekly .NET newsletter:
https://www.milanjovanovic.tech
Read my Blog here:
https://www.milanjovanovic.tech/blog
Chapters
0:00 Test setup with NSubstitute, exposing internal members
4:47 Test cases for the "Create user" use case
12:58 Test cases for the "Start following" use case
21:21 How writing testable code makes testing easier
22:31 Code coverage overview