This repository contains the example code for a blog post on unit testing complicated calculations.
It is good to make tests as descriptive as possible, to achieve Tests as Documentation. Including the calculations in the test is a big part of this, and avoids the Hard Coded Test Data smell.
This example code has an initial naive test, which is around 30 lines long. It doesn't include the calculations, and introducing them would make the test even longer and more complicated, so would be hard to justify.
The blog describes a series of refactorings, which build on the existing test refactorings from XUnit Test Patterns.
The refactorings reduce the number of paths through the code and simplify the test. This means that less tests are needed, and that the tests become small and simple enough to include the calculations.