Summary

Completed

The goal of this module was to help you understand how to write and run tests by using Visual Studio test tools. By completing all the units, you:

  • Created a test project, added references, and implemented the three A's: arrange, act, and assert.
  • Viewed, ran, and debugged tests by using test tools in Visual Studio, including Test Explorer and the editor test tools.
  • Expanded your test-writing skills with Fluent Assertions, data-driven tests, and mocking.

Recall the calculator app example from the beginning of this module. As the functionality of the app expanded, more inputs needed to be checked. Manually testing by running the app and trying it out can take a long time.

With tests, you can create test methods to put your app through its paces programmatically. You can save all those inputs in your test methods that make sure the behavior of your code stays stable even as you make changes. Test Explorer enables you to view your tests, run them automatically with one click, and debug specific parts of your code through your tests.

References