ASP.NET Core 1 MVC Testing Fundamentals
ASP.NET Core MVC is the latest evolution of .NET web programming. In this course, you'll learn how to create automated tests to cover the different parts of your ASP.NET Core MVC application to help find errors before they make it to production.
What you'll learn
No one likes the stress of emergencies caused by errors in code that have been released to production, especially if these errors happen early in the morning and require emergency fixes. Automated tests help check the application is working as expected, and reduces the likelihood of errors making it to the production environment. Fewer production errors mean happier end users, development teams, and business owners. In this course, ASP.NET Core 1 MVC Testing Fundamentals, you'll learn how to create automated tests for your ASP.NET Core MVC application, including model, controller, and automated UI tests. First, you'll dive into getting started with xUnit.net, and how to specifically test your model. Next, you'll explore how to isolate parts of your code base by using mock objects and the Moq library for .NET Core. Finally, you'll cover how to automate the browser to create functional UI tests. By the end of this course, you'll have the knowledge to create automated unit, integration, and UI tests for your ASP.NET Core MVC application. Additionally, you'll know how to execute these tests to verify the correctness of your application, and help ensure errors do not make it to production.
Table of contents
- Introduction 2m
- xUnit.net Overview 5m
- Overview of Application Changes 1m
- Adding a FrequentFlyerNumberValidator Class 3m
- Creating the First Test 7m
- Adding Additional FrequentFlyerNumberValidator Tests 5m
- Creating a CreditCardApplicationEvaluator Class 2m
- Testing the CreditCardApplicationEvaluator 5m
- Running Tests at the Command Line 2m
- Summary 1m
- Introduction 2m
- Isolating Parts of the Application with Mock Objects 4m
- Mocking in .NET Core with Moq 2m
- Adding a Dependency to the CreditCardApplicationEvaluator 2m
- Fixing the CreditCardApplicationEvaluator Tests 1m
- Adding Frequent Flyer Logic to the CreditCardApplicationEvaluator 5m
- Creating Mock Dependencies with Moq 4m
- Refactoring Existing Tests to Use Mock Objects 5m
- Summary 1m
- Introduction 2m
- Integration Testing ASP.NET Core with TestServer 2m
- Creating an ASP.NET Core Integration Test Project 3m
- Testing HTTP GET Operations 7m
- Using Entity Framework Core In-memory Server 4m
- Testing HTTP POST Operations 4m
- Dealing with Anti Forgery Tokens in Integration Tests 4m
- Refactoring to a TestServer Class Fixture 3m
- Testing API Value Controllers 2m
- Summary 2m