Sha256: 944dfa82ca1379f0c7f4777fdf19b5f818425479faec6151b25ff64fadbce904

Contents?: true

Size: 1.14 KB

Versions: 44

Compression:

Stored size: 1.14 KB

Contents

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;

public class PrimeCalculatorTest {
    private PrimeCalculator primeCalculator;

    @Before
    public void setup() {
        primeCalculator = new PrimeCalculator();
    }

    @Rule
    public ExpectedException thrown = ExpectedException.none();

    @Test
    public void testFirstPrime() {
        assertThat(primeCalculator.nth(1), is(2));
    }

    @Ignore("Remove to run test")
    @Test
    public void testSecondPrime() {
        assertThat(primeCalculator.nth(2), is(3));
    }

    @Ignore("Remove to run test")
    @Test
    public void testSixthPrime() {
        assertThat(primeCalculator.nth(6), is(13));
    }

    @Ignore("Remove to run test")
    @Test
    public void testBigPrime() {
        assertThat(primeCalculator.nth(10001), is(104743));
    }

    @Ignore("Remove to run test")
    @Test
    public void testUndefinedPrime() {
        thrown.expect(IllegalArgumentException.class);
        primeCalculator.nth(0);
    }

}

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
trackler-2.1.0.32 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.31 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.30 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.29 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.28 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.27 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.26 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.25 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.24 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.23 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.22 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.21 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.20 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.19 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.18 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.17 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.16 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.15 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.14 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.13 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java