c# - How to test approximate values in Fitnesse -
i'm using fitnesse fitsharp run integration tests. i'm using rowfixture test table of numerical results , need able test approximate value 3 decimal places. how can achieve this? read somewhere using ~= not appear work on tables
yes, slim test system in fitnesse offers approximately equals operator (~=
) point out agree not available in fitsharp. 2 possibilities consider:
first (though have not had occasion use them) fitsharp offers variety of cell operators--see, in particular, compare foating point on list.
second, 1 technique have used this:
that is, math fixture lets specify precision (defaulting 2 places if unspecified). code-behind quite simple:
private double docalculation() { . . . return math.round(_result, precision); }
Comments
Post a Comment