Chapter 9, Unit Testing
- Unit tests are critical for ensuring the quality of your code and allow you to add to and change your code with the confidence of knowing that if you break something, you’ll find out about it right away.
- Most of the testable code in a .NET MAUI application will be in the ViewModel or, possibly, the services.
- When you need a slower service to test a method in your code, a mock can stand in for that service and give you immediate responses.
- In order to provide a mock to your test, you must be able to inject it into the code in lieu of the runtime object.