I'm currently in the middle of refactoring an important method in a legacy-system. There were almost zero test until I've started working on it, and I've added quite a lot to ensure the correct work after my refactorings.
Now I've came across the most crucial part: the algorithm that calculates an indicator. It's something like
indicator = (OneNumberFromA + AnotherNumberFromB) / elapsedTime;
How can I test the correct behavior for this Function with Unit tests?
There are also some slightly different algorithms in the functions, that the program reaches in some cases - but in all of them, the
elapsedTime is vital to the outcome.