diff --git a/aics-domain/src/testFixtures/java/professor/domain/ProfessorDomainTest.java b/aics-domain/src/testFixtures/java/professor/domain/ProfessorDomainTest.java index 1125837c..06af5f04 100644 --- a/aics-domain/src/testFixtures/java/professor/domain/ProfessorDomainTest.java +++ b/aics-domain/src/testFixtures/java/professor/domain/ProfessorDomainTest.java @@ -1,5 +1,6 @@ package professor.domain; +import static kgu.developers.domain.professor.domain.Role.ASSISTANT; import static kgu.developers.domain.professor.domain.Role.PROFESSOR; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -31,4 +32,76 @@ public void createProfessor_Success() { assertEquals(contact, professor.getContact()); assertEquals(email, professor.getEmail()); } + + @Test + @DisplayName("PROFESSOR 객체의 이름을 수정할 수 있다") + public void updateName_Success() { + // given + String name = "박민준"; + Role role = PROFESSOR; + String contact = "010-1234-5678"; + String email = "alswns11346@kgu.ac.kr"; + Professor professor = Professor.create(name, role, contact, email); + + // when + String newName = "이신행"; + professor.updateName(newName); + + // then + assertEquals(newName, professor.getName()); + } + + @Test + @DisplayName("PROFESSOR 객체의 역할을 수정할 수 있다") + public void updateRole_Success() { + // given + String name = "박민준"; + Role role = PROFESSOR; + String contact = "010-1234-5678"; + String email = "alswns11346@kgu.ac.kr"; + Professor professor = Professor.create(name, role, contact, email); + + // when + Role newRole = ASSISTANT; + professor.updateRole(newRole); + + // then + assertEquals(newRole, professor.getRole()); + } + + @Test + @DisplayName("PROFESSOR 객체의 연락처를 수정할 수 있다") + public void updateContact_Success() { + // given + String name = "박민준"; + Role role = PROFESSOR; + String contact = "010-1234-5678"; + String email = "alswns11346@kgu.ac.kr"; + Professor professor = Professor.create(name, role, contact, email); + + // when + String newContact = "010-1234-8765"; + professor.updateContact(newContact); + + // then + assertEquals(newContact, professor.getContact()); + } + + @Test + @DisplayName("PROFESSOR 객체의 메일을 수정할 수 있다") + public void updateEmail_Success() { + // given + String name = "박민준"; + Role role = PROFESSOR; + String contact = "010-1234-5678"; + String email = "alswns11346@kgu.ac.kr"; + Professor professor = Professor.create(name, role, contact, email); + + // when + String newEmail = "new-email@kyonggi.ac.kr"; + professor.updateEmail(newEmail); + + // then + assertEquals(newEmail, professor.getEmail()); + } }