Transcripted Summary

NUnit is an open-source unit-testing framework that began as a .NET port of the popular Java testing framework, JUnit.



Today, NUnit is one of the most popular testing frameworks in the .NET ecosystem.

And while we'll be using C# for this course, NUnit supports all .NET-based languages including VB.NET, F#, and even C++.

Our unit testing framework supports 3 key elements in automated testing.



# The first element is test writing.

Automated tests generally follow a similar pattern.

  • Some setup may need to be performed.

  • Then it comes to the actual steps of the test that need to be executed.

  • And finally, some form of validation is performed to determine if a test is passed or failed.

Frameworks provide a specific set of methods, patterns, or conventions that you'll need to use while authoring tests in order for the test framework to properly handle your tests.

And you can think of this as the recipe that you need to follow for the framework to properly interpret and ultimately execute your test code.

# The second element is actually running tests.

Frameworks provide a means to execute your tests.This could be via a visual interface, a command line executable, or a test runner, maybe being integrated into your IDE.

Running tests also includes the ability to run a single test, multiple tests, or all tests.

And there may be options for the order of tests are executed, or whether or not tests are executed in series or in parallel.

# The last element is report.

A framework needs to provide some means for showcasing the results of a test run.

It may come in a variety of formats including basic text output, a structured format like XML or JSON, or a nice pretty visual report with charts and graphs.

You might be wondering how a unit testing tool fits into your automation framework, since you aren't necessarily writing unit tests.

Despite being initially created for unit testing, the core elements of unit testing frameworks apply to all other types of automated tests like integration, API, or end-to-end test, just as well as unit tests.

Because NUnit is flexible enough to execute any type of test code that we supply, we don't need specialized components for automation frameworks. NUnit provides all the scaffolding or structure that we need for supporting the writing, executing, and reporting of any testing scenario.