I am currently reading Uncle Bob's books, trying to embrace TDD in my professional life. At the moment I am in doubt about whether it is necessary to write tests like that:
public class Person {
private String firstName;
private String middleName;
private String lastName;
/*getters and setters*/
}
@Test
public void testPersonCreation() {
Person person = new Person();
person.setFirstName("Robert");
person.setMiddleName("Cecil");
person.setLastName("Martin");
Assertions.assertThat(person.getFirstName()).isEqualTo("Robert");
Assertions.assertThat(person.getMiddleName()).isEqualTo("Cecil");
Assertions.assertThat(person.getLastName()).isEqualTo("Martin");
}
What are pros and cons of such approach?