REFACTORING UNIT TESTS in ASP NET Core | Getting Started With ASP.NET Core Series
Rahul Nath Rahul Nath
30.9K subscribers
9,365 views
0

 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 !!

show more

Share/Embed