Data-driven unit testing is an important concept of TDD that brings many benefits, by allowing you to test your code base extensively with real-life data from multiple data sources, giving you the insight needed to tweak and refactor code for better performance and robustness.
In this chapter, we covered the benefits of data-driven testing and how to write effective data-driven tests using the inline and properties attributes of xUnit.net. Furthermore, we explored data-driven unit testing using the Theory attribute available in xUnit.net. This allows you to unit test your code for appropriate validation and verification over a wide range of inputs coming from different data sources.
While the default data source attributes provided by xUnit.net are very useful, you can further extend the DataAttribute class and create a custom attribute to load data from another source...