-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
3 changed files
with
45 additions
and
9 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
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
29 changes: 29 additions & 0 deletions
29
server/src/test/java/server/haengdong/domain/ActionTest.java
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package server.haengdong.domain; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class ActionTest { | ||
|
||
@DisplayName("액션의 초기 순서번호는 1이다.") | ||
@Test | ||
void createFirst() { | ||
Event event = new Event("name", "token"); | ||
Action action = Action.createFirst(event); | ||
|
||
assertThat(action.getSequence()).isOne(); | ||
} | ||
|
||
@DisplayName("현재 액션의 다음 액션의 순서는 1만큼 증가한다.") | ||
@Test | ||
void next() { | ||
Event event = new Event("name", "token"); | ||
Action action = new Action(event, 2L); | ||
|
||
Action nextAction = action.next(); | ||
|
||
assertThat(nextAction.getSequence()).isEqualTo(3L); | ||
} | ||
} |