Skip to main content
CourseFlix

Mastering C# Unit Testing

3h 59m 22s
English
Paid

This course shows you how to write clear and reliable unit tests in C#. You learn by studying real code and seeing what works and what fails. The lessons stay practical, so you can use the ideas in your own projects.

What You Learn

You follow simple steps to build tests that are easy to read and trust. You also study common mistakes, so you know what to avoid.

Test Quality

You compare good tests and bad tests. You see why some tests break often and how to fix them. You learn how to name tests, set them up, and keep them small.

Tools You Use

You work with tools that C# developers use every day. This includes test runners, mocks, and ways to check code behavior. You learn when to use each tool and when not to.

Real Code Practice

You write tests for real C# code, not toy samples. This helps you deal with files, services, and other common parts of an app.

Why This Course Helps

The lessons come from years of writing and fixing tests in production apps. You get clear steps and plain rules that help you write stable tests without guesswork.

  • Learn solid testing patterns.
  • Spot weak tests and improve them.
  • Work with common C# testing tools.
  • Practice with real project code.
  • Build tests that are easy to change.

About the Author: Julio Casal

Julio Casal thumbnail
Over the last decade, I helped multiple teams at Microsoft build all sorts of C#/.NET cloud-based services that handle millions of requests every month. Then, in early 2023, I got laid off. So, before jumping into another 9-5 job, I decided to dedicate my full time to creating educational content around Microsoft developer technologies, which I had been doing on the side so far. Today I run a one-person business that teaches .NET developers how to unlock the power of the .NET platform to reach the next level in their careers. When I'm not working on my business, I'm enjoying time with my wife and three kids, playing board games, watching movies or enjoying beautiful places around Washington state.

Watch Online 44 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 44 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Course introduction
All Course Lessons (44)
#Lesson TitleDurationAccess
1
Course introduction Demo
00:39
2
Course outline
01:03
3
Is this course for you?
00:42
4
Software prerequisites
00:49
5
Setting up VS Code for unit testing
02:06
6
Introduction
00:32
7
Avoid testing implementation details
06:04
8
Use fakes wisely
09:34
9
Avoid multiple AAA sections
03:31
10
Avoid logic in tests
04:41
11
Reusing test fixtures
07:29
12
Working with time
07:08
13
Testing private methods
07:14
14
Introduction
00:23
15
Choosing what to test
02:59
16
The ASP.NET Core API you will unit test
12:18
17
Refactoring overcomplicated code – Take 1
06:30
18
Refactoring overcomplicated code – Take 2
06:31
19
Refactoring overcomplicated code – Take 3
07:10
20
Introduction
00:26
21
Testing entities
11:42
22
Testing application services
12:09
23
Testing error mapping logic
07:34
24
Testing data repositories
02:30
25
Testing controllers
08:21
26
Testing minimal APIs
08:49
27
Introduction
00:28
28
What is code coverage?
01:32
29
Using code coverage in VS Code
10:54
30
Using code coverage in Visual Studio
03:00
31
What’s the ideal code coverage number?
02:12
32
Configuring what to include in code coverage
06:55
33
Increasing the coverage
04:55
34
Introduction
00:25
35
Running tests in parallel
04:10
36
Using AutoFixture
08:03
37
Using live unit testing
06:24
38
Unit testing with ChatGPT
12:49
39
Introduction
00:22
40
Clean architecture quick recap
03:01
41
The application to test
13:34
42
What should you test?
03:03
43
Unit testing the application
13:19
44
Running code coverage
05:22
Unlock unlimited learning

Get instant access to all 43 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

Books

Read Book Mastering C# Unit Testing

#TitleTypeOpen
1HandoutsPDF
2Net8UpgradePDF