Architecting an ASP.NET Core MVC Application for Unit Testability
Want to quickly and easily know if your app is working? You'll need automated tests. This course will show you how to architect an ASP.NET Core app so that you can write great automated unit tests.
What you'll learn
You need unit tests if you want to know if your app is really and truly working. The problem is that it's not always easy to do. In this course, Architecting an ASP.NET Core MVC Application for Unit Testability, you will gain the ability to design your apps for testability. First, you will learn about the architectural design patterns that help make your application easy to test, refactor, and maintain. Next, you will discover how to apply these architectural design patterns in order to implement testable ASP.NET Model-View-Controller code and testable database code using Entity Framework Core. Finally, you will explore how to apply these design patterns to create testable security code, validation code, and Web API code. When you are finished with this course, you will have the skills and knowledge of software architecture and unit testing needed to design your ASP.NET Core apps for testability.
Table of contents
- Introduction 1m
- User Interface Testing and the MVC Design Pattern 5m
- Thinking About Unit Testing ASP.NET MVC and Demo Overview 4m
- Demo Part 1 of 3: Setting up the Unit Test and ASP.NET Code 6m
- Demo Part 2 of 3: Creating the Model and ASP.NET Controller 6m
- Demo Part 3 of 3: Unit Testing the Operators Drop-down List 6m
- Demo: Unit Testing Adding Two Numbers in the Web Calculator 9m
- Demo: Unit Testing an Error Case in the Web Calculator 5m
- Dependency Injection in an ASP.NET Controller 3m
- Demo: Refactor the Controller and Unit Tests to Use Dependency Injection 6m
- Mocks, Stubs, Fakes, and Dependency Injection 3m
- Demo Part 1 of 2: Using a Mock to Unit Test an ASP.NET Controller 7m
- Demo Part 2 of 2: Using a Mock to Do Behavior Verification 3m
- Summary 1m
- Introduction 1m
- Databases Are Hard to Test. So What Do You Do About It? 4m
- The Object-relational Impedance Mismatch Problem 9m
- Designing and Implementing Repositories 6m
- EF Core and the Adapter Pattern: It's the Right Thing to Do and the Tasty Way to Do It 4m
- The Design of the Sample Application 4m
- Demo: Implementing the Adapter Pattern 8m
- Demo Part 1 of 2: Reusable EF Core Repository Classes 7m
- Demo Part 2 of 2: Integration Testing EF Core Repositories 8m
- Demo: Implementing the Service Layer Pattern 5m
- Demo Part 1 of 3: Unit Test Structure for Service Layer Business Logic 4m
- Demo Part 2 of 3: Writing Service Layer Business Logic Unit Tests 8m
- Demo Part 3 of 3: Using an In-memory Repository for Unit Testing 2m
- Summary 1m
- Introduction 1m
- Validation, ASP.NET's ModelState.IsValid, and the Strategy Pattern 5m
- Validation with System.ComponentModel.DataAnnotations 3m
- Demo Part 1 of 2: Implement Validation with the Strategy Pattern 7m
- Demo Part 2 of 2: Use Strategy Pattern in an ASP.NET MVC Controller 3m
- Demo: Implementing Validation Using a Custom Validation Attribute 6m
- Demo: Implementing Validation Using IValidatableObject 4m
- Demo Part 1 of 2: Using the Strategy Pattern to Implement a Calculation 4m
- Demo Part 2 of 2: Connecting the Calculation Strategy in to the Application 4m
- Summary 1m
- Introduction 1m
- Routing in ASP.NET MVC Core 3m
- Demo Part 1 of 2: Create a New Controller Action and a Custom Route 5m
- Demo Part 2 of 2: ASP.NET Integration Tests for the Custom Route 4m
- Demo Part 1 of 2: Legacy URL Route Integration Tests 6m
- Demo Part 2 of 2: Implementing Controller Routes for Legacy URLs 4m
- Summary 1m
- Introduction 1m
- Security Overview: Authentication, Authorization, Roles, and Claims 6m
- Coding Security in ASP.NET Core 4m
- Authorization in ASP.NET Core 3m
- Policy-based Authorization and Authorization Handlers in ASP.NET Core 3m
- Demo: Unit Testing the Authorize Attribute 13m
- Demo Part 1 of 4: Policy-based Authorization in ASP.NET Core 6m
- Demo Part 2 of 4: Unit Testing Policy-based Authorization 7m
- Demo Part 3 of 4: Implementing AuthorizationHandler<T> in ASP.NET Core 3m
- Demo Part 4 of 4: Configuring the Authorization Policy in ASP.NET Core 3m
- Summary 1m
- Introduction 1m
- Demo Part 1 of 2: Using the Strategy Pattern to Make Security Decisions 6m
- Demo Part 2 of 2: Implementing IUserAuthorizationStrategy with Claims-based Authorization 9m
- ASP.NET Core Middleware 2m
- Demo Part 1 of 4: Using Custom Middleware to Populate User Claims 3m
- Demo Part 2 of 4: Implementing Custom Middleware with Unit Tests 7m
- Demo Part 3 of 4: Configuring Custom Middleware in ASP.NET Core 3m
- Demo Part 4 of 4: Connecting Middleware, IUserAuthorizationStrategy, and Views 3m
- Summary 1m