An intro to Test Driven Development (TDD) in C# using xUnit. Covers TDD principles (Red/Green/Refactor), setup, and writing testable code using SOLID and dependency injection. Compares TDD with traditional approaches and examines impacts on code quality and development velocity.
Overview
Syllabus
- Unit 1: Lesson: Introduction to TDD with C#: What, Why, and How
- Write a Test, Watch It Fail
- Make the Test Pass
- Refactor for Readability and Clarity
- Unit 2: Generalizing Solutions with Test Driven Development (C#)
- Write another failing test
- Make it pass again
- Refactor to use parameterized tests
- Unit 3: The TDD Mindset: Thinking in Tests with C#
- Defining the first test for Shopping Cart totals
- Make it pass
- Write another failing test
- Make the Cart Total Function Work
- Refactor Your Cart Total Function
- Make it Red
- Make it Green
- Refactor!
- Unit 4: Setting Up and Mastering Testing in C# with xUnit
- Understanding Testing with XUnit in C#
- Use some Verifiers
- Refactor Test Setup with Constructors
- Group Email Tests Using Nested Classes
- Expect an exception
- Write an async test
- Unit 5: Managing Dependencies in TDD with C#
- Write your first failing test
- Make it pass
- Refactor
- Write a test that expects logging (Red)
- Make the tests pass
- Refactor the UserManager Class
- Unit 6: Introduction to the AAA Pattern in TDD with C# xUnit
- Refactor Tests with AAA Pattern