Test Driven Development in C# 8
Test Driven Development (TDD) is a powerful approach to build solid and robust software. This course teaches you how to use TDD in C# to test and implement new features in your .NET projects.
What you'll learn
At the core of writing solid and robust C# code is a thorough knowledge of Test Driven Development (TDD). In this course, Test Driven Development in C# 8, you will learn the skills you need to be able to apply TDD in your .NET projects. First, you will discover the basics of TDD and about the red-green-refactor cycle. Next, you will learn how to test and implement business logic for a .NET Core application with TDD. You’ll use xUnit as a testing framework and Moq as a mocking library. Finally, your business logic will be used in an ASP.NET Core Razor Pages application, and you will use TDD to add additional features in that application. When you’re finished with this course, you’ll have a foundational knowledge of Test Driven Development that will help you as you move forward to test and implement new features in your C# projects.
Table of contents
- Version Check 0m
- Introduction 1m
- What Is Test Driven Development (TDD)? 2m
- Advantages of Test Driven Development 4m
- The Wired Brain Coffee Scenario 3m
- How This Course Is Structured 3m
- Understand the First Requirement 3m
- Create a Red Unit Test 7m
- Write Code to Make the Test Green 1m
- Refactor the Code 4m
- Test and Implement the Next Requirement 3m
- Refactor the Test Code 2m
- Summary 1m
- Introduction 1m
- Understand the Requirements 2m
- Know How to Decouple Dependencies 5m
- Test: Save a Desk Booking 8m
- Implement: Save a Desk Booking 1m
- Refactor the Code 4m
- Test: Check if a Desk Is Available 7m
- Implement: Check if a Desk Is Available 2m
- Test: Store the Desk ID on the Booking 4m
- Implement: Store the Desk ID on the Booking 2m
- Test: Return Success or NoDeskAvailable Result Code 5m
- Implement: Return Success or NoDeskAvailable Result Code 1m
- Test: Set Desk Booking ID on the Result 5m
- Implement: Set Desk Booking ID on the Result 1m
- Summary 1m
- Introduction 1m
- Test Driven Development of User Interfaces 4m
- Explore the DeskBooker Solution 6m
- Understand the Requirements 3m
- Test: Call the BookDesk Method of the Processor 5m
- Implement: Call the BookDesk Method of the Processor 3m
- Test: Check if the Model Is Valid 3m
- Implement: Check if the Model Is Valid 1m
- Test: Add a Model Error if No Desk Is Available 4m
- Implement: Add a Model Error if No Desk Is Available 4m
- Refactor the Unit Tests 3m
- Test: Return the Expected IActionResult 6m
- Implement: Return the Expected IActionResult 2m
- Test: Redirect to the BookDeskConfirmation Page 7m
- Implement: Redirect to the BookDeskConfirmation Page 2m
- Run the ASP.NET Core Application 4m
- Summary 2m