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.53 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.52 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.51 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.50 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.49 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.48 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.47 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.46 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.45 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.44 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.43 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.42 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.41 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.40 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.39 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.38 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.37 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.36 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.34 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java
trackler-2.1.0.33 tracks/java/exercises/nth-prime/src/test/java/PrimeCalculatorTest.java