December 21, 2009 UnitTesting
December 21, 2009 UnitTesting
Have you ever faced with UT that failed once and then you always see it succeeded?
One of such tests could be test where you verify that date properties of some newly created entity are equal if they take DateTime.Now for that.
Today Hudson showed me that some test failed in project I worked near half a year ago, so test looked like:
Test failed because time difference between dates was greater than few milliseconds. This could occur when processor is too occupied.
So I changed assert call to more realistic:
code
more code
~~~~