Summary
Throughout this chapter, we have learned about testing software and especially Blazor WebAssembly components. First, we introduced the concept of testing, why it’s important, and the difference between unit testing and E2E testing. Then we introduced bUnit and set up the testing project. After that, we discovered the default tests written in a bUnit testing project template before starting to write our own, while learning gradually about bUnit’s features. While writing tests, we saw the need for mocking and faking services and features to satisfy the CUT. We learned about the Moq framework and the built-in mocking and faking services within bUnit. Finally, we introduced the Playwright library for .NET, which we can use to write E2E tests in Blazor WebAssembly.
After completing this chapter, you should be able to do the following:
- Understand the importance of testing software
- Be familiar with the bUnit library and its features
- Write unit tests...