This whole "how to" is very simplistic. It shows that it was written by a programmer who never done any serious testing.
Testing code that depends on time is very complicated, and solutions aren't about whether you have factory methods or use C++ templates. That's by and large irrelevant. To the best of my knowledge there isn't any strategy that would handle all aspects of testing time-sensitive code. The goals and means are very different between different test cases.
I wouldn't even dare to try to catalogue all the possible problems with testing time-sensitive programs... this is just too big of a subject to try to cover in few paragraphs.
Testing code that depends on time is very complicated, and solutions aren't about whether you have factory methods or use C++ templates. That's by and large irrelevant. To the best of my knowledge there isn't any strategy that would handle all aspects of testing time-sensitive code. The goals and means are very different between different test cases.
I wouldn't even dare to try to catalogue all the possible problems with testing time-sensitive programs... this is just too big of a subject to try to cover in few paragraphs.