public class RatioTestDoubleValueMatcher extends java.lang.Object implements ValueMatcher
ValueMatcher
which compares doubles using a ratio test
with a tolerance. Ratio tests are applicable when the range of
values are not known a priori. The basic idea is that the
ratio expect/actual
will be within 1 +/- tolerance
regardless of the magnitude of expected or actual, allowing a default
tolerance to be more generally applicable.Constructor and Description |
---|
RatioTestDoubleValueMatcher(double expected) |
RatioTestDoubleValueMatcher(double expected,
double tolerance) |
public RatioTestDoubleValueMatcher(double expected)
public RatioTestDoubleValueMatcher(double expected, double tolerance)
public boolean matches(java.lang.Object actual)
ValueMatcher
matches
in interface ValueMatcher
public com.google.gson.JsonElement describe(com.google.gson.Gson gson)
ValueMatcher
describe
in interface ValueMatcher