Skip to content

Mocking

This tutorial will walk you through running an existing unit test for the ModelApp. These are basic tests designed to get you comfortable using the Visual Studio Unit Testing Framework also known as MSTest. Click on this link MSTest to learn more about the MSTest framework attributes.

This lab will introduce you to mocking external services within your Unit Tests. These initial tests are designed to showcase why mocking is necessary, how use them in your tests, and general best practices.


Overview

  • Discuss mocks and how they are used in Unit Tests
  • Dive into the ModelApp code to see why we need to mock the NewsAPI
  • Get some hands-on experience with writing our own tests