
Explore the basics of unit testing, including what unit tests are, frameworks exist, naming conventions, how to run and debug tests, and the benefits and who should write them.
Describe a unit test as a function that calls another function and verifies the outcome, with the system under test isolated from dependencies and faster, more reliable than integration tests.
Explore popular unit testing frameworks such as NUnit, xUnit, and MSTest, and learn that once you master any framework, you can write tests across tools with minimal difference.
Create a dedicated unit test project in Visual Studio, install NUnit and the NUnit 3 test adapter, and write a passport method test using test fixture and test attributes.
Learn naming conventions for NUnit and C# unit tests, including three major styles (should-descriptive method names, unit under test underscore forms, and three-part underscore names) with examples and use cases.
Navigate Visual Studio's test explorer to build, discover, and run NUnit tests, create test playlists, run or debug individual tests with breakpoints, group tests, and enable test execution after builds.
Unit tests verify that parsing methods work correctly, catching regressions before shipping and speeding development. They provide a safety net for continuous integration, guiding when and who writes tests.
Discover why developers must write unit tests, the role of testers in manual testing, and how unit tests provide a fast safety net for code changes.
Explore programmer responsibility and the role of unit testing and test-driven design in ensuring safe, reliable software through vows of honesty, frequent incremental releases, and continuous improvement.
Practice unit testing with a degree converter in C#, using NUnit. Create two projects, write two tests for the Celsius and Fahrenheit methods, and follow test fixture guidelines.
Create a degree converter tests class in the tests project, write NUnit tests for Celsius to Fahrenheit and Fahrenheit to Celsius, and run them with the test adapter to verify.
Discover how a unit test validates a unit within the system under test, explore common unit test naming templates, and learn how Visual Studio detects tests after rebuilds.
Learn to install a unit testing framework and runner in Visual Studio, write assertions with the unit API, run tests from console, and understand setup, teardown, grouping, and code coverage.
Explore the assertion model at the heart of unit tests in NUnit and C#, using is, has, and does constraints to build expressive condition checks across strings and arrays.
Demonstrates how to unit-test a game character class with NUnit and C#, covering string validations, ignore-case comparisons, numeric and floating-point checks with tolerance, booleans, nulls, and collection and object-reference assertions.
Learn the arrange-act-assert pattern for unit testing, setting up the system under test, invoking methods, and verifying outcomes with assertions in NUnit and C#.
Learn how to run unit tests from the console using the NUnit standalone runner, including installing NUnit, locating the test assembly, and executing tests from the command prompt.
Explore how set up runs before each test and tear down after each test in NUnit, preventing shared state and disposing resources to avoid memory leaks.
Demonstrates set up fixture usage at assembly and namespace levels to initialize and clean up before tests, with one-time set up and tear down methods driving the test runner.
Refactor two health tests into a single parameterized test using the test case attribute to pass damage and expected health values, with data driven options via test case source.
Group slow tests with a category attribute at class or method level to organize them in the test explorer, and ignore failing tests with the ignore attribute.
Understand code coverage as a metric that shows how much code is covered by tests, expressed as percentages in Visual Studio's code coverage results, reflecting software health.
Explore fizzbuzz in C# with NUnit by implementing a function that returns fizz for multiples of 3, buzz for 5, fizzbuzz for both, or empty otherwise, and write unit tests.
Explore how to implement and test a single FizzBuzz method in C# using NUnit's test case attributes, with a single test method and fixture validating multiple inputs.
Implement a roman numeral parser in C# and handle subtractive notation, then validate your algorithm with unit tests to ensure correctness.
This lecture walks through implementing a roman numeral parser in C# using a dictionary to map roman numerals to Arabic values, handling subtractive notation, and validating with NUnit tests.
Write unit tests for a stack's public API, using push, pop, and peek to exercise last-in, first-out behavior, and anticipate the next lecture's solution.
Learn to unit test a stack in C# with NUnit, covering empty stack, count after pushes, pop exceptions, and peek behavior across push-pop sequences.
Apply the arrange–act–assert pattern in NUnit to write valuable unit tests, run them from the console, and use setup, teardown, and parameterized tests while grouping tests.
Discover a bonus video in the beginners guide to unit testing with NUnit and C#, and access additional resources by joining the mailing list for discounts and blog updates.
This course is all about writing unit tests using C# programming language and NUnit as a unit testing framework. Today unit testing is an absolutely required skill from any professional developer. Companies expect from developers to know how to write unit tests.
Learning unit testing puts a powerful and very useful tool at your fingertips. Being familiar with unit testing you can write reliable and maintainable applications. It is very hard to lead a project which is not covered by unit tests.
Content and Overview
This course is primarily aimed at beginner developers.
We start with basics of unit testing. What is a unit test? What unit testing frameworks exist? How to run and debug unit tests. After getting acquainted with the basics, we will get to the NUnit framework. Here you’ll learn how to install the framework, set the runner. Then you’ll learn the basics of assertions and arrange-act-assert triplet. Other key features of NUnit are also covered: