@Test public void should_verify_that_assertIsSorted_is_called() { LongArrays arrays = mock(LongArrays.class); LongArrayAssert assertions = new LongArrayAssert(emptyArray()); assertions.arrays = arrays; assertions.isSorted(); verify(arrays).assertIsSorted(assertions.info, assertions.actual); }
@Test public void should_fail_if_actual_contains_given_value_at_given_index() { thrown.expect(AssertionError.class); assertions.doesNotContain(new Long(4), index); }
@Test public void should_throw_error_if_given_index_is_null() { thrown.expect(AssertionError.class); assertions.doesNotContain(value, null); }
@Test public void should_throw_error_if_actual_is_empty() { thrown.expect(AssertionError.class); assertions = new LongArrayAssert(new long[0]); assertions.doesNotContain(value, index); }
@Test public void should_return_this_if_actual_does_not_contain_given_value_at_given_index() { LongArrayAssert returned = assertions.doesNotContain(value, index); assertSame(returned, assertions); }
@Test public void should_pass_if_actual_does_not_contain_given_value_at_given_index() { assertions.doesNotContain(value, index); }
@Test public void should_return_this() { LongArrayAssert objectArrayAssert = new LongArrayAssert(new long[] {1, 2}); assertSame(objectArrayAssert, objectArrayAssert.isSorted()); }