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: Test-Driven Development in C#

    Learn Test-Driven Development (TDD) in C# from the ground up! This course covers everything from the basics to advanced TDD concepts, helping you write cleaner, more maintainable code.

    About This Course

    Test-Driven Development (or TDD for short) is one of the most essential software development practices. It is a practice based on the simple idea that instead of writing our code first and then later writing tests for it, we write our tests first, and then we write code that makes those tests pass. This approach has many advantages, from productivity gains to ensuring that our work doesn't get out of scope to ultimately writing better, focused code with cleaner interfaces and looser coupling. TDD can change the way we think about building software. In this course, Gui Ferreira will teach you everything you need to know to practice TDD, from the most basic concepts to some very advanced ones and make it part of your software development lifecycle.

    Course Curriculum

    5h 41m 9 sections
    Welcome
    01:37 Free preview
    What will you learn in this course?
    03:43 Free preview
    Who is the course for and prerequisites
    01:58 Free preview
    What is TDD?
    02:43
    Benefits and drawbacks of TDD
    07:11
    "Test-First" vs "Test-After"
    02:21
    How to define a Unit in Unit Testing
    03:23
    Red-Green-Refactor cycle
    03:12
    The 3 Rules of TDD
    02:42
    Incrementalism
    02:33
    Section recap
    00:24
    The example we will work on
    02:16
    Creating a Testing List
    05:56
    Writing the first Tests
    29:58
    Using Tests as Documentation
    07:21
    Section recap
    00:49
    The example we will work on
    01:14
    Writing application level tests
    06:56
    What is a Test Double?
    02:53
    Building Dummies
    02:40
    Building Stubs
    04:00
    Building Spies
    02:59
    Building Mocks
    09:49
    Building Fakes
    03:42
    Fixtures, Setup, and Teardown
    06:05
    How to TDD on Integration Testing
    03:39
    Test-driving a Storage Adapter
    25:08
    Test-driving a REST API
    19:48
    Section recap
    00:36
    The example we will work on
    00:29
    Detroit vs London school
    01:05
    What is the Detroit School style?
    01:42
    What is the London School style?
    02:11
    Practicing TDD in a London School style
    27:36
    Section Recap
    00:31
    Naming Tests
    02:35
    How to organize tests
    01:54
    Applying Act-Arrange-Assert
    02:29
    Using 1 Assertion per test
    02:35
    Start from the end
    03:10
    Improving test readability
    04:20
    How to solve bugs with TDD
    03:36
    What are TDD Driving Patterns
    00:47
    Driving Patterns: Fake It
    05:53
    Driving Patterns: Triangulation
    07:05
    Driving Patterns: Obvious Implementation
    03:00
    The Four Rules to Simple Design
    02:21
    Anti-patterns and how to avoid them
    06:45
    Section recap
    00:44
    TDD in Agile software development and DevOps
    07:39
    How BDD and ATDD relate to TDD
    05:09
    How TDD relates to the Testing Pyramid
    05:00
    TDD and Source Control
    05:59
    Pair Programming when doing TDD
    03:05
    Defining Team testing policies
    04:32
    The value of Code Coverage when doing TDD
    01:46
    Using Mutation Testing to improve TDD skills
    04:51
    Handling Objections and Challenges to TDD Adoption
    03:27
    Section recap
    00:48
    The example we will work on
    02:15
    What is Legacy Code
    01:36
    How to use Approval Testing
    10:44
    Refactoring to Support Testing
    26:53
    Test-driving new Behaviour
    06:34
    Section recap
    00:28
    Conclusion
    01:01

    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#