Published On Jul 29, 2021
Hello Friends, Writing maintainable and robust unit tests is hard. Often when making changes to our main code a lot of tests break, making it hard to refactor and update code. We also avoid writing tests for the same reasons. Setting up test data can also be painful and makes tests less maintainable.
In this video, I will walk you through a refactoring exercise of making tests more maintainable and robust. I use existing tests from Microsoft documentation examples and walk through the existing issues and how to make them better.
00:00 Introduction
02:45 - Common Problems
06:00 - AutoFixture Introduction & Setup
07:38 - Automatic Data Setup
13:18 - Domain-Specific Data Setup
25:15 - Enumerable Test Data
27:57 - Mocking Dependencies
Additional Watching
š¹ AutoFixture Series - Ā Ā Ā ā¢Ā AutoFixtureĀ Ā
š¹ASP NET Core Series - Ā Ā Ā ā¢Ā ASP.NETĀ CoreĀ Ā
š¹Logging - Ā Ā Ā ā¢Ā LOGGINGĀ inĀ ASP.NETĀ CoreĀ |Ā GettingĀ Sta...Ā Ā
LInks
š AutoFixture - https://autofixture.github.io/
šRefactored Source Code - https://rahulpnath.visualstudio.com/D...
šUnit Tests - https://docs.microsoft.com/en-us/aspn...
š Don't Let Entity Framework Fool Your Constructors - https://www.rahulpnath.com/blog/dont-...
Come say hi! ā
š Blog - https://rahulpnath.com/
ā Subscribe to my Newsletter - https://www.rahulpnath.com/subscribe
š¦Twitter - Ā Ā /Ā rahulpnathĀ Ā
šøInstagram - Ā Ā /Ā rahulpnathĀ Ā
š„ Recording Setup and Workflow - https://www.rahulpnath.com/blog/youtu...
Make sure to SUBSCRIBE to the channel. THANK YOU for helping me grow this channel !!