Navigating Various Unit Test Frameworks
Understand the principles of automated unit testing across various frameworks including NUnit, xUnit, and MSTest. Learn the structure, syntax, and common attributes used in these .NET unit test frameworks, and see how unit testing principles apply regardless of the testing tool.
Introduction
The basic principles of automated unit testing are agnostic to the programming language and testing framework used. However, to learn unit testing principles, unit tests must be written using one of the many programming languages and testing frameworks available. There are many testing frameworks available for any programming language. Although the principles of unit testing are consistent across various frameworks, the implementation details vary. Therefore, knowledge of one framework is easily transferable to another framework.
Sample unit testing landscape
Numerous unit test frameworks exist across a variety of languages and within any given language. The listing below shows the diverse landscape:
Unit Testing Framework Landscape
Programming Languages | |||||||||||
Some unit testing frameworks | Small Talk | C | C++ | C#,F,# Visual Basic | Fortran | Java | Javas-cript | PERL | PHP | Python | Ruby |
SUnit | Parasoft C/C++ test | Criterion | xUnit.net | FUnit | Jtest | JSUnit | TAP | PHPUnit | Doctest | Test:: Unit | |
CU | CUTE | NUnit | Fruit | JUnit | Qunit | Test:: More | lime | Autotest | Rspec | ||
Cutter | Google Test | MSTest | pFUNIT | TestNG | Mocha | Test:: Class | Tester | Unittest | minitest | ||
The languages under the “C#” column are .NET-supported languages. The cells highlighted in blue are not based on “xUnit.”
Historically, one ...