File tree Expand file tree Collapse file tree
src/test/java/com/kakao/onboarding/precource/dukeyun/baseball/baseball Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .kakao .onboarding .precource .dukeyun .baseball .baseball ;
2+
3+ import static org .assertj .core .api .Assertions .assertThatThrownBy ;
4+
5+ import org .junit .jupiter .api .DisplayNameGeneration ;
6+ import org .junit .jupiter .api .DisplayNameGenerator ;
7+ import org .junit .jupiter .api .Test ;
8+
9+ @ DisplayNameGeneration (DisplayNameGenerator .ReplaceUnderscores .class )
10+ class BaseballGameTurnInputTest {
11+
12+ @ Test
13+ public void 세자리가_아닌_숫자가_들어오면_예외를_발생시킨다 () throws Exception {
14+ // given
15+ // when
16+ //then
17+ assertThatThrownBy (() -> {
18+ new BaseballGameTurnInput ("1234" );
19+ }).isInstanceOf (RuntimeException .class );
20+ }
21+
22+ @ Test
23+ public void 숫자가_아니면_예외를_발생시킨다 () throws Exception {
24+ // given
25+ // when
26+ //then
27+ assertThatThrownBy (() -> {
28+ new BaseballGameTurnInput ("1aa" );
29+ }).isInstanceOf (IllegalArgumentException .class );
30+ }
31+
32+ @ Test
33+ public void 중복된_숫자면_예외를_발생시킨다 () throws Exception {
34+ // given
35+ // when
36+ //then
37+ assertThatThrownBy (() -> {
38+ new BaseballGameTurnInput ("112" );
39+ }).isInstanceOf (RuntimeException .class );
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments