Package org.fest.assertions.data

Examples of org.fest.assertions.data.Index


  }

  @Test
  public void should_fail_if_index_is_out_of_boundary() {
    int[] actual = { 1, 2, 3, 4 };
    Index index = Index.atIndex(4);
    String format = "Index should be between <%d> and <%d> (inclusive,) but was <%d>";
    thrown.expect(IndexOutOfBoundsException.class, String.format(format, 0, 3, 4));
    arrays.assertContains(description, actual, value, index);
  }
View Full Code Here


  @Test
  public void should_fail_if_actual_does_not_contain_value_at_given_index() {
    int[] actual = { 1, 2, 3, 4 };
    int value = 3;
    Index index = Index.atIndex(3);
    try {
      arrays.assertContains(description, actual, value, index);
    } catch (AssertionError e) {
      verify(failures).failure(description, shouldContainAtIndex(actual, value, index, Array.get(actual, index.value)));
      return;
View Full Code Here

  @Test
  public void should_pass_if_actual_contains_value_at_given_index() {
    int[] actual = { 1, 2, 3, 4 };
    int value = 3;
    Index index = Index.atIndex(2);
    arrays.assertContains(description, actual, value, index);
  }
View Full Code Here

  @Test
  public void should_fail_if_actual_contains_value_at_given_index() {
    int[] actual = { 1, 2, 3, 4 };
    int value = 3;
    Index index = Index.atIndex(2);
    try {
      arrays.assertDoesNotContain(description, actual, value, index);
    } catch (AssertionError e) {
      verify(failures).failure(description, ShouldNotContainAtIndex.shouldNotContainAtIndex(actual, value, index));
      return;
View Full Code Here

  @Test
  public void should_pass_if_actual_is_empty() {
    int[] actual = {};
    int value = 3;
    Index index = Index.atIndex(1);
    arrays.assertDoesNotContain(description, actual, value, index);
  }
View Full Code Here

  @Test
  public void should_pass_if_actual_does_not_contain_value_at_given_index() {
    int[] actual = { 1, 2, 3, 4 };
    int value = 3;
    Index index = Index.atIndex(1);
    arrays.assertDoesNotContain(description, actual, value, index);
  }
View Full Code Here

  @Test
  public void should_fail_if_actual_contains_value_at_given_index() {
    long[] actual = { 1, 2, 3, 4 };
    long value = 3;
    Index index = Index.atIndex(2);
    try {
      arrays.assertDoesNotContain(description, actual, value, index);
    } catch (AssertionError e) {
      verify(failures).failure(description, ShouldNotContainAtIndex.shouldNotContainAtIndex(actual, value, index));
      return;
View Full Code Here

  @Test
  public void should_pass_if_actual_is_empty() {
    long[] actual = {};
    long value = 3;
    Index index = Index.atIndex(1);
    arrays.assertDoesNotContain(description, actual, value, index);
  }
View Full Code Here

  @Test
  public void should_pass_if_actual_does_not_contain_value_at_given_index() {
    long[] actual = { 1, 2, 3, 4 };
    long value = 3;
    Index index = Index.atIndex(1);
    arrays.assertDoesNotContain(description, actual, value, index);
  }
View Full Code Here

TOP

Related Classes of org.fest.assertions.data.Index

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.