Bläddra i källkod

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 år sedan
förälder
incheckning
2346a9c63e

+ 0
- 1
exercises/nth-prime/build.gradle Visa fil

@@ -8,7 +8,6 @@ repositories {
8 8
 
9 9
 dependencies {
10 10
   testCompile "junit:junit:4.12"
11
-  testCompile "org.assertj:assertj-core:3.2.0"
12 11
 }
13 12
 test {
14 13
   testLogging {

+ 6
- 5
exercises/nth-prime/src/test/java/PrimeTest.java Visa fil

@@ -1,31 +1,32 @@
1 1
 import org.junit.Test;
2 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 7
 public class PrimeTest {
7 8
 
8 9
     @Test
9 10
     public void testFirstPrime() {
10
-        assertThat(Prime.nth(1)).isEqualTo(2);
11
+        assertThat(Prime.nth(1), is(2));
11 12
     }
12 13
 
13 14
     @Ignore
14 15
     @Test
15 16
     public void testSecondPrime() {
16
-        assertThat(Prime.nth(2)).isEqualTo(3);
17
+        assertThat(Prime.nth(2), is(3));
17 18
     }
18 19
 
19 20
     @Ignore
20 21
     @Test
21 22
     public void testSixthPrime() {
22
-        assertThat(Prime.nth(6)).isEqualTo(13);
23
+        assertThat(Prime.nth(6), is(13));
23 24
     }
24 25
 
25 26
     @Ignore
26 27
     @Test
27 28
     public void testBigPrime() {
28
-        assertThat(Prime.nth(10001)).isEqualTo(104743);
29
+        assertThat(Prime.nth(10001), is(104743));
29 30
     }
30 31
 
31 32
     @Ignore