DevOps Foundations: Validate Your Work with Automated Testing
In this lab, you’ll practice creating automated testing using the xUnit framework. When you’re finished, you’ll have the understanding necessary to begin validating your code with automated unit testing.
Terms and conditions apply.
Lab info
Lab author
Challenge
Get Started in the Lab Environment
Here are the initial instructions and explanation of the lab environment. Read this while your environment is busy creating itself from nothing. Yes, this violates physics; we know. How fun!
Challenge
Examine a Test Project
Test projects typically sit externally to the code so they don’t interfere with production instances. To start this lab, you will examine a software project in Visual Studio Code, and run its unit tests.
Challenge
Create a Simple Test
In this challenge, you’ll create a simple test that exercises the function you want covered. You’ll learn the triple-A pattern in testing, and how to create a meaningful assertion that validates that the logic is correct.
Challenge
Create Code using Test-driven Development
To finish this lab, you will start to create new code by writing the test first. This will allow you to clarify the expectations of the code’s behavior, and guarantee that it will be covered by a unit test.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.
Recommended prerequisites
- Basic software development knowledge
- Some C#, Visual Studio Code, and Linux CLI familiarity is helpful, but not required