30% OFF - Use code HANDSON30 for 30% off any course or Dometrain Pro! Browse courses →
  • Courses
  • Learning Paths
  • Blogs
  • Authors
  • Leaderboard
  • Dometrain Pro
  • Shopping Basket

    Your basket is empty

  • Business Portal
  • 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.

    About This Course

    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 Curriculum

    6h 11 sections
    Welcome
    01:21 Free preview
    What will you learn in this course?
    01:34 Free preview
    Who is the course for and prerequisites
    01:45 Free preview
    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

    Meet Your Instructor

    Gui Ferreira

    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.

    View all courses by Gui Ferreira

    What's New

    Getting Started: Model Context Protocol (MCP)
    course

    Getting Started: Model Context Protocol (MCP)

    Learn how to get started with the Model Context Protocol (MCP) and integrate it into your applications.

    Learn more about Getting Started: Model Context Protocol (MCP)
    Hands-On: Learn TypeScript
    course

    Hands-On: Learn TypeScript

    Learn TypeScript through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn TypeScript
    Hands-On: Learn JavaScript
    course

    Hands-On: Learn JavaScript

    Learn JavaScript through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn JavaScript
    Hands-On: Data Structures & Algorithms in C#
    course

    Hands-On: Data Structures & Algorithms in C#

    Master data structures and algorithms through hands-on coding exercises in C#. Free to enroll for 7 days!

    Learn more about Hands-On: Data Structures & Algorithms in C#
    Blogsmith.ai
    feature

    Blogsmith.ai

    Turn your videos into blogs and newsletters with AI. Check out our new product at blogsmith.ai.

    Learn more about Blogsmith.ai
    Leaderboard
    feature

    Leaderboard

    See how you stack up against other learners. Track your progress, climb the ranks, and compete with the Dometrain community.

    Learn more about Leaderboard
    Hands-On: Learn PostgreSQL
    course

    Hands-On: Learn PostgreSQL

    Learn PostgreSQL through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn PostgreSQL
    Free Hands-On: C# for Beginners
    course

    Free Hands-On: C# for Beginners

    Learn C# through hands-on coding exercises. Practice what you learn with interactive challenges designed for everyone, from beginners to experts.

    Learn more about Free Hands-On: C# for Beginners
    Getting Started: AI for .NET Developers
    course

    Getting Started: AI for .NET Developers

    Get started with integrating AI into your .NET applications effectively using the latest LLM best practices.

    Learn more about Getting Started: AI for .NET Developers
    Getting Started: Building .NET Applications on AWS
    course

    Getting Started: Building .NET Applications on AWS

    Learn how to build and deploy .NET applications on AWS using CDK, Lambda, DynamoDB, S3, and more.

    Learn more about Getting Started: Building .NET Applications on AWS
    What's new in C# 14
    blog

    What's new in C# 14

    This guide covers every new C# 14 feature, explains its benefits, and provides practical code examples to help you navigate how you can use them.

    Learn more about What's new in C# 14
    Let's Build It: AI Chatbot with RAG in .NET Using Your Data
    course

    Let's Build It: AI Chatbot with RAG in .NET Using Your Data

    Build a Retrieval-Augmented Generation (RAG) chatbot that can answer questions using your data.

    Learn more about Let's Build It: AI Chatbot with RAG in .NET Using Your Data
    From Zero to Hero: SignalR in .NET
    course

    From Zero to Hero: SignalR in .NET

    Enable enterprise-grade real-time communication for your web apps with SignalR.

    Learn more about From Zero to Hero: SignalR in .NET
    Deep Dive: Solution Architecture
    course

    Deep Dive: Solution Architecture

    Master solution architecture and turn business needs into scalable, maintainable systems.

    Learn more about Deep Dive: Solution Architecture
    Migrating: ASP.NET Web APIs to ASP.NET Core
    course

    Migrating: ASP.NET Web APIs to ASP.NET Core

    A step-by-step process to migrate ASP.NET Web APIs from .NET Framework to ASP.NET Core.

    Learn more about Migrating: ASP.NET Web APIs to ASP.NET Core
    Getting Started: Caching in .NET
    course

    Getting Started: Caching in .NET

    Let's make the hardest thing in programming easy for .NET software engineers.

    Learn more about Getting Started: Caching in .NET
    From Zero to Hero: Testing with xUnit in C#
    course

    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.

    Learn more about From Zero to Hero: Testing with xUnit in C#
    Create a ChatGPT Console AI Chatbot in C#
    blog

    Create a ChatGPT Console AI Chatbot in C#

    This walkthrough is your hands-on entry point to create a basic C# console application that talks to ChatGPT using the OpenAI API.

    Learn more about Create a ChatGPT Console AI Chatbot in C#