Просмотр исходного кода

Issue 199: Replaced assertj assetions in nth-prime test with junit and hamcrest assertions. Removed assertj from nth-prime gradle build file. (#215)

FridaTveit 9 лет назад
Родитель
Сommit
2346a9c63e
2 измененных файлов: 6 добавлений и 6 удалений
  1. 0
    1
      exercises/nth-prime/build.gradle
  2. 6
    5
      exercises/nth-prime/src/test/java/PrimeTest.java

+ 0
- 1
exercises/nth-prime/build.gradle Просмотреть файл

8
 
8
 
9
 dependencies {
9
 dependencies {
10
   testCompile "junit:junit:4.12"
10
   testCompile "junit:junit:4.12"
11
-  testCompile "org.assertj:assertj-core:3.2.0"
12
 }
11
 }
13
 test {
12
 test {
14
   testLogging {
13
   testLogging {

+ 6
- 5
exercises/nth-prime/src/test/java/PrimeTest.java Просмотреть файл

1
 import org.junit.Test;
1
 import org.junit.Test;
2
 import org.junit.Ignore;
2
 import org.junit.Ignore;
3
 
3
 
4
-import static org.assertj.core.api.Assertions.assertThat;
4
+import static org.hamcrest.CoreMatchers.*;
5
+import static org.junit.Assert.*;
5
 
6
 
6
 public class PrimeTest {
7
 public class PrimeTest {
7
 
8
 
8
     @Test
9
     @Test
9
     public void testFirstPrime() {
10
     public void testFirstPrime() {
10
-        assertThat(Prime.nth(1)).isEqualTo(2);
11
+        assertThat(Prime.nth(1), is(2));
11
     }
12
     }
12
 
13
 
13
     @Ignore
14
     @Ignore
14
     @Test
15
     @Test
15
     public void testSecondPrime() {
16
     public void testSecondPrime() {
16
-        assertThat(Prime.nth(2)).isEqualTo(3);
17
+        assertThat(Prime.nth(2), is(3));
17
     }
18
     }
18
 
19
 
19
     @Ignore
20
     @Ignore
20
     @Test
21
     @Test
21
     public void testSixthPrime() {
22
     public void testSixthPrime() {
22
-        assertThat(Prime.nth(6)).isEqualTo(13);
23
+        assertThat(Prime.nth(6), is(13));
23
     }
24
     }
24
 
25
 
25
     @Ignore
26
     @Ignore
26
     @Test
27
     @Test
27
     public void testBigPrime() {
28
     public void testBigPrime() {
28
-        assertThat(Prime.nth(10001)).isEqualTo(104743);
29
+        assertThat(Prime.nth(10001), is(104743));
29
     }
30
     }
30
 
31
 
31
     @Ignore
32
     @Ignore