-
Notifications
You must be signed in to change notification settings - Fork 738
Expand file tree
/
Copy pathPlayerTest.java
More file actions
26 lines (21 loc) · 954 Bytes
/
PlayerTest.java
File metadata and controls
26 lines (21 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package ladder.domain.player;
import ladder.view.fake.FakeInputView;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
class PlayerTest {
@Test
@DisplayName("참여자의 이름이 5글자가 넘으면 예외가 발생한다.")
void getPlayerName() {
FakeInputView inputView = new FakeInputView("yeseul");
assertThatThrownBy(() -> new Player(inputView.inputPlayerNames()))
.isInstanceOf(IllegalArgumentException.class);
}
@Test
@DisplayName("참여자의 이름은 쉼표가 아닌 다른 구분자가 사용되면 예외가 발생한다.")
void getSplitter() {
FakeInputView inputView = new FakeInputView("yeseul,pobi|crong");
assertThatThrownBy(() -> new Players(inputView.inputPlayerNames()))
.isInstanceOf(IllegalArgumentException.class);
}
}