$15

Unit Testing 201: Mastering C# Unit Testing with Real-world Examples

I want this!

Unit Testing 201: Mastering C# Unit Testing with Real-world Examples

$15

Write readable and maintainable unit tests in C# by refactoring real code examples.

You've learned the basics of unit testing in C#, but you still struggle with writing tests that are easy to read and maintain.

You've seen too many online tutorials testing a Calculator class, but you want to learn how to test real code. Code with dependencies, validations, and edge cases. Code that looks like the code you find every day at work.

That's why I created this course.

No more unit testing the Add() method of a Calculator class.

In this course, let's refactor real unit tests to make them more readable and maintainable.

Although I've changed names, classes, and methods to avoid disclosing code from past clients and employers, these are the tests I had to work with as a software engineer.

You'll learn how to transform messy and convoluted tests into readable and maintainable tests using proven principles and methods.

Who is this course for?

This course is for you if you are:

  • A C# developer who wants to level up your unit testing skills and write better tests
  • A C# developer who is tired of boring and unrealistic tutorials and wants to learn from real code examples

After completing this course, you'll be able to:

  • Use builder methods to simplify your tests
  • Write tests for multiple test values to make your tests more maintainable
  • Choose good names and use simple test values to make your tests easier to follow
  • Write domain-specific assertion methods to have more readable tests

Mastering these skills will help you to write tests easy to follow.

The next time you open one of your tests, you won't need to scratch your head trying to figure out what you were doing.

But here's the thing:

This is not an introductory course on unit testing.

You'll take more out of this course if you know how to write unit tests with a testing framework like MSTest, a mocking library like Moq, and the Arrange/Act/Assert pattern.

We're not covering how to write your first unit tests. We're covering unit testing best practices to make your tests readable and maintainable while we refactor real unit tests.

If you're new to unit testing, check out my ebook, Unit Testing 101, first. It covers the fundamentals of unit testing in C# — From zero to your first unit tests in C#.

But if you know what mocks are in unit testing, you're in the right place.

What is inside?

In this course, you will get access to:

  • Eight lessons that cover different best practices for unit testing
  • More than ten unit tests that show real code examples that need refactoring
  • Four exercises that challenge you to apply what you learned and refactor a unit test on your own
  • One checklist that summarizes the best practices from the course

Ready for a preview? Click the video at the top of the page.

These are the modules and lessons inside:

  1. Testing AccountController............................4m45s
    • Use Builder Methods
    • Test IOptions Interface
    • Make Test Values Obvious
    • (Optional) Check for Missing Configuration Values Inside Constructors
  2. Testing PaymentRequestValidator...............3m40s
    • Use Parameterized Tests
    • Use FluentValidation Helpers
    • Use Parameterized Tests Insted of Loops
  3. Testing PaymentService.................................4m35s
    • Test a Single Concerned Per Test
    • Test Exception Messages
  4. Testing PayoutService....................................7m17s
    • Visually Structure Tests
    • (Optional) Use Fakes in Unit Testing
    • (Optional) Create Fakes With Moq
    • Use TypeBuilder
    • Avoid Overspecification
  5. Testing DictionaryExtensions.......................7m28s
    • Use Simple Test Values
    • Exercise: Refactor a Test That Merges Dictionaries
  6. Testing SendEmailCommandHandler.........10m26s
    • Test Public Behavior
    • Create a Custom Verify Method
    • Exercise: Refactor a Test That Stores an Email With Duplicated Addresses
  7. Testing UpdateStatusCommandHandler..12m11s
    • Avoid Hidden Assumptions
    • Exercise: Refactor a Test That Updates an Email Status
  8. Testing ImportGuestsService.......................4m46s
    • Use Object Mothers
    • Exercise: Refactor a Test That Uploads Guests

Join "Unit Testing 201"!

If you want to write readable and maintainable unit tests in C# by refactoring real code examples, this course is for you.

Click the "I Want This!" button and join "Unit Testing 201" today to start writing readable and maintainable unit tests in C#.

I want this!
Watch link provided after purchase
Modules
8
Video Lessons
16
Text Lessons
3
Unit Tests
+10
Exercises
4
Checklists
1
Videos
59m
Copy product URL
30-day money back guarantee