Package org.fest.assertions.data

Examples of org.fest.assertions.data.Index


  @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_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_does_not_contain_value_at_index() {
    boolean value = true;
    Index index = atIndex(1);
    try {
      arrays.assertContains(description, actual, value, index);
    } catch (AssertionError e) {
      verify(failures).failure(description, shouldContainAtIndex(actual, value, index, false));
      return;
View Full Code Here

    arrays.assertDoesNotContain(description, actual, 'a', atIndex(6));
  }

  @Test
  public void should_fail_if_actual_contains_value_at_index() {
    Index index = atIndex(0);
    try {
      arrays.assertDoesNotContain(description, actual, 'a', index);
    } catch (AssertionError e) {
      verify(failures).failure(description, shouldNotContainAtIndex(actual, 'a', index));
      return;
View Full Code Here

  }

  @Test
  public void should_fail_if_actual_contains_value_at_index() {
    boolean value = true;
    Index index = atIndex(0);
    try {
      arrays.assertDoesNotContain(description, actual, value, index);
    } catch (AssertionError e) {
      verify(failures).failure(description, shouldNotContainAtIndex(actual, value, index));
      return;
View Full Code Here

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

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

    lists.assertContains(description, actual, "Yoda", Index.atIndex(5));
  }

  @Test
  public void should_fail_if_actual_does_not_contain_value_at_given_index() {
    Index index = Index.atIndex(1);
    try {
      lists.assertContains(description, actual, "Leia", index);
    } catch (AssertionError e) {
      verify(failures).failure(description, shouldContainAtIndex(actual, "Leia", index, "Yoda"));
      return;
View Full Code Here

    arrays.assertContains(description, actual, "Yoda", atIndex(6));
  }

  @Test
  public void should_fail_if_actual_does_not_contain_value_at_index() {
    Index index = atIndex(1);
    try {
      arrays.assertContains(description, actual, "Han", index);
    } catch (AssertionError e) {
      verify(failures).failure(description, shouldContainAtIndex(actual, "Han", index, "Luke"));
      return;
View Full Code Here

  }

  @Test
  public void should_fail_if_index_is_out_of_boundary() {
    long[] 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

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.