Skip to content
Search lessons, topics, tests…
Esc

    ↑ ↓ moveEnter openEsc close
    ASP.NET Core and Web APIs: back to the track

    Guided course · ASP.NET Core and Web APIs

    Unit Testing in .NET: xUnit, Test Doubles and TDD

    • Write fast, readable unit tests with xUnit v3 on .NET 10.
    • Choose the right test double, and know when not to mock.
    • Test async code, time and randomness without flaky tests.
    • Read coverage and mutation scores honestly, and practise test-driven development.
    Intermediate5 modules · 14 lessons · 2 h 49 min · 9 practice tests · 2 free

    Module 1 · Unit Test Basics

    3 lessons · 35 min
    1. 01What Makes a Good Unit Test in .NET: The Answer Interviewers WantFree, 1 practice test13 min
    2. 02xUnit v3 Basics: Facts, Theories, Assertions and Running Tests on .NET 10Free, 1 practice test11 min
    3. 03xUnit vs NUnit vs MSTest: Lifecycle, Parallel Runs and the New Test Platform (included with Full Access), 1 practice test11 min

    Module 2 · Test Doubles and Testable Design

    4 lessons · 50 min
    1. 04Test Doubles in C#: Dummy, Stub, Fake, Spy and Mock (included with Full Access), 1 practice test13 min
    2. 05Designing Testable C# Code: Seams, Dependency Injection and Legacy Code (included with Full Access), 1 practice test12 min
    3. 06Moq, NSubstitute and FakeItEasy: Mocking Libraries, Limits and Licences (included with Full Access)13 min
    4. 07When to Mock and When Not To: Test Behavior, Not Implementation (included with Full Access)12 min

    Module 3 · Async, Time and Flaky Tests

    3 lessons · 36 min
    1. 08Testing Async Code in C#: Tasks, Exceptions and Cancellation (included with Full Access), 1 practice test12 min
    2. 09Testing Time and Randomness: TimeProvider, FakeTimeProvider and Seeds (included with Full Access), 1 practice test11 min
    3. 10Flaky Unit Tests: Shared State, Test Order, Parallel Runs and Culture (included with Full Access), 1 practice test13 min

    Module 4 · Readable Tests and Honest Metrics

    2 lessons · 24 min
    1. 11Readable Tests: Naming, Test Data Builders and Assertion Libraries (included with Full Access)11 min
    2. 12Code Coverage and Mutation Testing: What the Numbers Really Tell You (included with Full Access), 1 practice test13 min

    Module 5 · Test-Driven Development

    2 lessons · 24 min
    1. 13Test-Driven Development in C#: Red, Green, Refactor Done Right (included with Full Access)11 min
    2. 14Capstone: Build a Login Lockout Class with TDD (included with Full Access)13 min

    TechInterviewNotes Editorial Team ·