-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8abeadc
commit a70045a
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = "[email protected]"; | ||
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 = "[email protected]"; | ||
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 = "[email protected]"; | ||
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 = "[email protected]"; | ||
Professor professor = Professor.create(name, role, contact, email); | ||
|
||
// when | ||
String newEmail = "[email protected]"; | ||
professor.updateEmail(newEmail); | ||
|
||
// then | ||
assertEquals(newEmail, professor.getEmail()); | ||
} | ||
} |