Trending Arrow Icon
Trending

C# Unit Testing with NUnit

blur

Learn Path Description

Unit testing has become standard practice for today's software developers and NUnit is one of the most popular and mature unit testing frameworks available for .NET. The goal of this learning path is to help you understand how to write clean, testable code, all the way from writing your first test to mocking out dependencies to developing a pragmatic suite of unit tests for your application.

Skills You Will Gain

Courses In This Learning Path

blur
icon

Total Duration

2.1 hours

icon

Level

Intermediate

icon

Learn Type

Certifications

Introduction to .NET Testing with NUnit 3

Unsuccessful release of code to production can lead to unhappy end-users, managers, and development teams. Nobody wants to be contacted in the middle of the night by someone stating that their production system is down and requires immediate attention. This course, Introduction to.NET Testing using NUnit 3, will teach you how to create automated tests that you can use to test your code. You will first learn how to create a test project, and then run tests. Next, you'll learn how to make test results more reliable, such as using numbers, collections and expected exceptions. You will also learn how to modify the test execution process, create data-driven tests, and customize NUnit. This course will equip you with the knowledge and skills to automate testing with NUnit so that you can prevent bugs from reaching production.

blur
icon

Total Duration

112 minutes

icon

Level

Intermediate

icon

Learn Type

Certifications

Mocking with Moq 4 and NUnit

Effective unit tests can be difficult to write when there are dependencies between classes. It is hard to distinguish what's being tested and the rest of your system. This course, Mocking using Moq 4 and NUnit will teach you how to isolate codebases for testing purposes. You will first learn how to replace mock objects with real dependencies. Next, you'll learn how to configure mocked properties, methods, exceptions and events. You will also learn how to create behavior-based test cases and how to create partial mocks using existing classes. This course will equip you with the knowledge and skills to mock with Moq in order to create automated tests using mock objects.

blur
icon

Total Duration

1.26 hour

icon

Level

Intermediate

icon

Learn Type

Certifications

Creating Maintainable Contexts for Automated Testing

This course will show you how to create a typical test context. It will also explain the factors that can make it fragile and difficult to maintain. We can use software principles that we are all familiar with and patterns that we might not have seen before to create contexts that focus on the most important information to understand what your tests are trying tell you. The Object Mother pattern is a common way to create test contexts. We will start with the general principles. We'll then move on to the Object Builder, a modern, expressive version of the Object Mother. You'll also learn how to use Roslyn C# scripts for the repetitive parts of the Object Builder patterns so you can get to the fun stuff. This course will give you an understanding of what makes a good test environment and how to use it in your current and future projects.

blur
icon

Total Duration

2.26 hours

icon

Level

Beginner

icon

Learn Type

Certifications

Test Driven Development in C#

A solid understanding of Test Driven Development is essential to writing robust and reliable C# code. This course will teach you how to use TDD in your.NET projects. You will first learn about TDD and the red-green refactor cycle. Next, you'll learn how to implement and test business logic in a.NET Core app using TDD. As a testing framework, you'll use xUnit and Moq to mock your code. Your business logic will be implemented in an ASP.NET Core Razor Pages app. You will also use TDD to add new features. This course will give you a solid foundation in Test Driven Development, which will be useful as you test and implement new features within your C# projects.

blur
icon

Total Duration

2.02 hours

icon

Level

Beginner

icon

Learn Type

Certifications

Writing Testable Code

Testable code is code that automates automated testing quickly, easily, and enjoyably. This course, Writing Testable Code teaches you how to create code that is easy for testing. These skills will allow you to easily refactor difficult-to-test code into testable code. You'll learn how to make your code testable by creating seams. Next, you will learn best practices to make testing code easier, such as simplifying object construction and working with dependencies. Finally, you will be able to manage application state. You'll also learn best practices by observing a code demonstration of each practice to see how it's implemented. This will make unit testing much easier. You'll be able to write testable code by the end of the course.

blur
icon

Total Duration

119 minutes

icon

Level

Beginner

icon

Learn Type

Certifications

.NET Unit Testing with AutoFixture 4

Automated test can be difficult to create and expensive to maintain. This course will teach you how to use AutoFixture for anonymously generating test data. You'll learn how AutoFixture can generate anonymous test data for both standard types and custom types. You'll learn how to customize and control the way AutoFixture generates anonymous tests objects. You'll be able to drastically reduce the amount test code that you have to write. AutoFixture will automatically create mock dependencies and create the object you are testing. This course will equip you with the knowledge and skills to create unit tests faster and more efficiently.

blur
icon

Total Duration

40 minutes

icon

Level

Intermediate

icon

Learn Type

Certifications

Improving Unit Tests with Fluent Assertions 5

It can be difficult to determine the cause of test failures when they occur. Sometimes, test failure messages that are unclear or not sufficiently detailed can make it difficult to understand why the tests failed. To find out the cause of the failure, you may need to open the debugger and put the test in debug mode. This course, Improving Unit Tests using Fluent Assertions 5, will teach you the basics of Fluent Assertions. You will first learn how to make your test code more readable. You will then explore how to assert on different types of result such as strings and floating point numbers. You will also learn how to improve test fail messages so that you don't waste time fixing failing tests. This course will equip you with the knowledge and skills to use Fluent Assertions to increase readability and test fail messages for automated tests.

blur