-
Notifications
You must be signed in to change notification settings - Fork 362
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
78 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package Test; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.Arrays; | ||
|
||
import static org.assertj.core.api.AssertionsForClassTypes.assertThat; | ||
|
||
class CompareTest { | ||
Compare compare; | ||
|
||
@BeforeEach | ||
void setUp(){ | ||
compare = new Compare(); | ||
} | ||
|
||
@Test | ||
@DisplayName("몇개의 숫자가 같은지 확인") | ||
void count(){ | ||
assertThat(3).isEqualTo(compare.howMany(Arrays.asList(1,2,3), Arrays.asList(3,1,2))); | ||
} | ||
|
||
@Test | ||
@DisplayName("스트라이크 수 확인") | ||
void strike(){ | ||
assertThat(1).isEqualTo(compare.countStrike(Arrays.asList(3,2,4),Arrays.asList(3,1,2))); | ||
} | ||
} |
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,30 @@ | ||
package Test; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.Arrays; | ||
|
||
import static org.assertj.core.api.AssertionsForClassTypes.assertThat; | ||
|
||
class CompareTest { | ||
Compare compare; | ||
|
||
@BeforeEach | ||
void setUp(){ | ||
compare = new Compare(); | ||
} | ||
|
||
@Test | ||
@DisplayName("몇개의 숫자가 같은지 확인") | ||
void count(){ | ||
assertThat(3).isEqualTo(compare.howMany(Arrays.asList(1,2,3), Arrays.asList(3,1,2))); | ||
} | ||
|
||
@Test | ||
@DisplayName("스트라이크 수 확인") | ||
void strike(){ | ||
assertThat(1).isEqualTo(compare.countStrike(Arrays.asList(3,2,4),Arrays.asList(3,1,2))); | ||
} | ||
} |
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,18 @@ | ||
package baseball.domain; | ||
|
||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.List; | ||
|
||
import static org.assertj.core.api.AssertionsForClassTypes.assertThat; | ||
|
||
class generateRandomNumTest { | ||
@Test | ||
@DisplayName("랜덤 숫자 생성 테스트") | ||
void randomTest(){ | ||
GenerateRandomNum generateRandomNum = new GenerateRandomNum(); | ||
List<Integer> test = generateRandomNum.create(); | ||
assertThat(3).isEqualTo(test.size()); | ||
} | ||
} |
7db5e02
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
미션 Test 진행한 mioyday/java-baseball-precourse mioyday 브랜치 => woowacourse/java-baseball main
브랜치로 Pull Request를 보낸다.