Data-Driven Unit Tests

In the last chapter, we discussed the attributes of good unit tests, as well as the two types of test supported by xUnit.net, Fact and Theory. Also, we walked through the creation of unit tests using the rich set of test assertions that are available in the xUnit.net unit testing framework.

Unit tests written for a software project should be run repeatedly right from the development stage, during deployment, during maintenance, and, effectively, throughout the life cycle of the project. Often, these tests should be run on different data inputs following the same execution steps, while the tests, and essentially, the code being tested are expected to have consistent behavior, irrespective of the data input.

Running tests ...

Get C# and .NET Core Test Driven Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.