Skip to content
drewbourne edited this page Sep 13, 2010 · 1 revision

between matches if the values is between the min and max values.

  assertThat(2, between(2, 4));

closeTo matches if a value is within +/- the error value from the given value.

  assertThat(3, closeTo(4, 1));

greaterThan matches if the item is greater than the given value.

  assertThat(5, greaterThan(4));

greaterThanOrEqualTo matches if the item is greater than or equal to the given value.

  assertThat(4, greaterThanOrEqualTo(4));

lessThan matches if the item is less than the given value.

  assertThat(3, lessThan(4));

lessThanOrEqualTo matches if the item is less than or equal to the given value.

  assertThat(4, lessThanOrEqualTo(4));