In this series of liveProjects, you’ll learn to design and implement automated testing for C# applications. You’ll go hands on with the everyday practices and tools developers use to ensure their software is effective and easy to maintain. Because all the tests you’ll learn are automated, you’ll free yourself from time-consuming manual testing and bug finding. Each project in this series covers a new form of C# automated testing, so you can pick the skills most relevant to your needs.
These projects are designed for learning purposes and are not complete, production-ready applications or solutions.
here's what's included
Project 1 Unit and Integration Tests
In this liveProject, you’ll learn to write effective unit tests for an existing ASP.NET e-commerce application. You’ll start by analyzing where unit tests can be implemented, then write and run those tests using Visual Studio and best practices. You’ll refactor those tests to the Builder pattern in order to reduce test code and improve maintainability. Finally, you’ll set up integration tests for code that rely on external dependencies, and use your tests to guide the creation of new functionality for your app.
Project 2 Isolate Dependencies with Mocks
External services, databases, and other dependencies are hard to run in a predictable way and can often cause test failures when there is no issue in your code. In this liveProject, you’ll isolate unnecessary dependencies and replace them with mock objects that have more manageable behavior. You’ll then be able to develop isolated unit tests, which do not break due to external reasons, are easy to write and run, and have fast execution times.
Project 3 Continuous Integration Pipeline
In this liveProject, you’ll create a continuous integration pipeline for your tests. Continuous Integration (CI) automates the testing of code whenever the code changes. This ensures code quality remains high and encourages regular merging and testing. You’ll use Azure DevOps to create and run a CI pipeline to build code, then run XUnit-based tests, set up filters for different tests, and add code coverage for analysis of run results.
Project 4 BDD and Acceptance Tests
In this liveProject, you’ll ensure your system behaves according to customer requirements by implementing acceptance tests. You’ll use SpecFlow and Gherkin to test existing functionality, WireMock to test each service with a fake interaction between services, and, finally, use behavior-driven development (BDD) and test-driven development (TDD) to create a new service.
Project 5 Working with Legacy Code
In this liveProject, you’ll refactor poorly written legacy code in a way that lets you make changes without fear of bugs. You’ll fix the internal structure of your code, make sure code functions according to your needs with integration tests, and make in-depth changes supported by your testing suite. Finally, you’ll develop new features inside code without major changes, and replace dependencies with mock objects to help test previously unmaintainable code.
This liveProject is for intermediate C# developers who want to improve their understanding of modern testing practices. No previous testing experience is required. To begin this liveProject, you will need to be familiar with the following:
- Intermediate C#
- Visual Studio: able to create new projects and install plugins, min. version 2019
- ASP.NET and web development, min. version .NET 5
- .NET desktop development
- .NET Core cross-platform development
- Basics of MongoDB
- Basics of Docker: able to run Docker and Docker Compose files from Visual Studio
- Basic YAML: able to read simple YAML files
- Basic REST and HTTP for creating web services
you will learn
In this liveProject, you’ll learn to write and automate unit tests that will give you a better understanding of how a piece of code works. Unit tests are one of the best ways to ensure your code remains seamlessly bug free.
- Configuring the environment for unit testing
- Analyzing an application to find where to apply unit tests
- Writing and running tests with XUnit and Visual Studio
- Refactoring tests to theories and the Builder pattern
- Writing and running integration tests
- Creating new functionalities using tests