@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()); }
@Test public void testToString() { Person person = new Person("Klaus", "Unger"); assertEquals("Person {firstName=Klaus, lastName=Unger}", person.toString()); }