Esempio n. 1
0
  @Test
  public void constructorWithValidArguments() {
    Person p = new Person("Klaus", "Unger");
    assertSame("Klaus", p.getFirstName());
    assertSame("Unger", p.getLastName());

    p = new Person("Klaus   ", "Unger   ");
    assertEquals("Klaus", p.getFirstName());
    assertEquals("Unger", p.getLastName());
  }
Esempio n. 2
0
 @Test
 public void testToString() {
   Person person = new Person("Klaus", "Unger");
   assertEquals("Person {firstName=Klaus, lastName=Unger}", person.toString());
 }