Closed GoogleCodeExporter closed 9 years ago
Double Assert already had this functionality. Users can either use the regular
'isEqualTo(double)' or the version using a delta:
double result = total(price, discount);
assertThat(result).withDelta(0.4d).isEqualTo(expected);
Not sure if we need to do this for float, for example, JUnit offers this
functionality for double only.
Original comment by Alex.Rui...@gmail.com
on 15 Oct 2007 at 6:13
Float should support this too. Not only double. I particularly don't like the
syntax:
assertThat(result).withDelta(0.4d).isEqualTo(expected);
It would be better to have something like:
assertThat(result).isEqualTo(expected, delta(0.4d));
We should always require the error margin. I'll take care of this bug.
Original comment by wanghy1...@gmail.com
on 8 Nov 2007 at 11:06
Removed 'withDelta' from DoubleAssert.
Added isEqualTo(expected, delta(value)) to both DoubleAssert and FloatAssert.
Original comment by wanghy1...@gmail.com
on 9 Nov 2007 at 5:58
Set the module as a label, instead of being part of the title.
Original comment by Alex.Rui...@gmail.com
on 1 Dec 2008 at 12:13
Original issue reported on code.google.com by
Alex.Rui...@gmail.com
on 24 Sep 2007 at 2:08