Back to School Sale! 🎉
Dometrain Pro 20% off with code BTS2025! (Excl. Business and VS Pro)
00
Days
00
Hrs
00
Min
00
Sec
Get Pro 20% off!

From Zero to Hero: Testing with xUnit in C#

Learn how to test any codebase in .NET with the latest version of xUnit, the industry-standard testing library.

Improve the quality of your C# code by learning automated testing with xUnit, the go-to framework for .NET developers. This detailed course guides you from writing your first test to applying advanced techniques. You'll cover essential topics like assertions, data-driven tests using theories, and managing the test lifecycle with fixtures. The course also covers best practices for structuring and organizing your tests for long-term maintainability. By the end, you'll be able to write effective tests for any .NET application, ensuring your code is robust, reliable, and easier to maintain.

Course trailer

Curriculum

Welcome (01:21)

What will you learn in this course? (01:34)

Who is the course for and prerequisites (01:45)

Introduction (07:08)

Setting Up Your First xUnit.net Project (16:09)

Writing and Running Your First Tests (12:54)

Section Recap (02:51)

Introduction (04:07)

Facts vs Theories When to Use Each (15:16)

Test Structure and Organisation (14:14)

Test Naming and Documentation (11:20)

Section Recap (03:07)

Introduction (05:07)

Basic Assertions (12:07)

String and Numeric Assertions (12:27)

Collection Assertions (06:10)

Exception Assertions (09:55)

Custom Assertions and Extensions (11:45)

Section Recap (02:43)

Introduction (01:21)

InlineData and Simple Parameterisation (07:06)

MemberData and ClassData Patterns (12:32)

Type-Safe TheoryData and TheoryDataRow (08:41)

MatrixTheoryData and Combinatorial Testing (05:27)

Section Recap (02:35)

Introduction (02:18)

Constructor and IDisposable Patterns (06:17)

IAsyncLifetime and Async Setup-Teardown (06:43)

Class Fixtures (06:29)

Collection Fixtures (06:15)

Assembly Fixtures (07:02)

Section Recap (02:34)

Introduction (01:58)

Parallel Execution, Test Collections and Ordering (08:12)

Dynamic Skipping and Conditional Tests (04:06)

Test Timeouts and Cancellation (07:52)

TestContext and Runtime Information (04:01)

Section Recap (01:21)

Introduction (01:05)

ITestOutputHelper and Console Output Capture (13:49)

Diagnostic Messages and Test Attachments (11:41)

Debugging Techniques (08:10)

Section Recap (01:16)

Introduction (02:14)

Built-in Report Formats and Coverage (11:30)

Configuration Files and Runtime Settings (07:53)

CI-CD Integration (07:00)

Section Recap (00:54)

Introduction (04:06)

Custom Test Attributes and Data Sources (13:47)

Test Traits (09:33)

Building Reusable Test Libraries (07:57)

Section Recap (01:29)

Conclusion (02:05)

Course Info

Level:
From Zero to Hero
Duration:
5h 59m
Rating (New):
star

Starting at

$41.66

per month

when billed annually

Subscribe to Pro

About the Author

author_img

Gui Ferreira

Guilherme Ferreira, also known as Gui, is a Minimalist Software Craftsman, passionate about simplicity and continuous learning. Gui is a Microsoft MVP for Developer Technologies, a Tech Speaker, a YouTuber, and a .NET content creator. With over 15 years of experience in software development, Gui went from Startups to Tech Giants. Along his journey, he got to know several hats, including Software Engineer, Architect, CTO, and Developer Advocate, gathering a diverse and invaluable skill set.

More courses by Gui Ferreira