Package org.assertj.core.groups

Examples of org.assertj.core.groups.Tuple


      throw new IllegalArgumentException("The object to extract fields/properties from should not be null");

    List<Extractor<T, Object>> extractors = buildExtractors();
    List<Object> values = extractValues(input, extractors);
   
    return new Tuple(values.toArray());
  }
View Full Code Here


 
  @Test
  public void should_extract_tuples_from_fields_or_properties() {
    Extractor<Employee, Tuple> extractor = new ByNameMultipleExtractor<Employee>("id", "age");
   
    Tuple extractedValue = extractor.extract(yoda);
    assertThat(extractedValue).isEqualTo(tuple(1L, 800));
  }
View Full Code Here

 
  @Test
  public void should_extract_tuples_with_consistent_iteration_order() {
    Extractor<Employee, Tuple> extractor = new ByNameMultipleExtractor<Employee>("id", "name.first", "age");

    Tuple extractedValues = extractor.extract(yoda);
    assertThat(extractedValues).isEqualTo(tuple(1L, "Yoda", 800));
  }
View Full Code Here

public class Tuple_Test {

  @Test
  public void should_create_tuple() {
    Tuple tuple = new Tuple("Yoda", 800, "Jedi");
    assertThat(tuple).isEqualTo(new Tuple("Yoda", 800, "Jedi"));
  }
View Full Code Here

    assertThat(tuple).isEqualTo(new Tuple("Yoda", 800, "Jedi"));
  }

  @Test
  public void should_create_empty_tuple() {
  Tuple tuple = new Tuple();
  assertThat(tuple).isEqualTo(new Tuple());
  }
View Full Code Here

  assertThat(tuple).isEqualTo(new Tuple());
  }
 
  @Test
  public void add_an_element_to_a_tuple() {
  Tuple tuple = new Tuple("Yoda", 800);
  tuple.addData("Jedi");
  assertThat(tuple).isEqualTo(new Tuple("Yoda", 800, "Jedi"));
  }
View Full Code Here

  }
 
  @SuppressWarnings("unchecked")
  @Test
  public void convert_tuple_to_an_array() {
  Tuple tuple = new Tuple("Yoda", 800, "Jedi");
  assertThat(tuple.toArray()).isEqualTo(array("Yoda", 800, "Jedi"));
  }
View Full Code Here

  assertThat(tuple.toArray()).isEqualTo(array("Yoda", 800, "Jedi"));
  }
 
  @Test
  public void tuple_representation() {
  Tuple tuple = new Tuple("Yoda", 800, "Jedi");
  assertThat(tuple.toString()).isEqualTo("(\"Yoda\", 800, \"Jedi\")");
  }
View Full Code Here

  @Test
  public void sohuld_allow_extracting_multiple_values_using_extractor() throws Exception {
    assertThat(employees).extracting(new Extractor<Employee, Tuple>() {
      @Override
      public Tuple extract(Employee input) {
        return new Tuple(input.getName().getFirst(), input.getAge(), input.id);
      }
    }).containsOnly(tuple("Yoda", 800, 1L), tuple("Luke", 26, 2L));
  }
View Full Code Here

public class Assertions_tuple_Test {

  @Test
  public void should_create_tuple() {
    Tuple tuple = Assertions.tuple("Yoda", 800, "Jedi");
    assertThat(tuple).isEqualTo(new Tuple("Yoda", 800, "Jedi"));
  }
View Full Code Here

TOP

Related Classes of org.assertj.core.groups.Tuple

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.