@Test public void should_fail_if_actual_is_greater_than_other() { AssertionInfo info = someInfo(); try { doubles.assertLessThanOrEqualTo(info, 8d, 6d); } catch (AssertionError e) { verify(failures).failure(info, shouldBeLessOrEqual(8d, 6d)); return; } throw expectedAssertionErrorNotThrown(); }
@Test public void should_fail_if_actual_is_null() { thrown.expectAssertionError(actualIsNull()); doubles.assertLessThanOrEqualTo(someInfo(), null, 8d); }
@Test public void should_pass_if_actual_is_equal_to_other() { doubles.assertLessThanOrEqualTo(someInfo(), 6d, 6d); }
@Before public void setUp() { failures = spy(new Failures()); doubles = new Doubles(); doubles.failures = failures; }