Sha256: 58b10fa7266402431eb3a4b722494d9dfa0a12430fc24884f04120b42a5dffc4

Contents?: true

Size: 835 Bytes

Versions: 116

Compression:

Stored size: 835 Bytes

Contents

import org.junit.Test
import org.junit.Ignore
import org.junit.Rule
import org.junit.rules.ExpectedException
import kotlin.test.assertEquals

class PrimeTest {

    @Rule
    @JvmField
    var expectedException: ExpectedException = ExpectedException.none()

    @Test
    fun firstPrime() {
        assertEquals(2, Prime.nth(1))
    }

    @Ignore
    @Test
    fun secondPrime() {
        assertEquals(3, Prime.nth(2))
    }

    @Ignore
    @Test
    fun sixthPrime() {
        assertEquals(13, Prime.nth(6))
    }

    @Ignore
    @Test
    fun bigPrime() {
        assertEquals(104743, Prime.nth(10001))
    }

    @Ignore
    @Test
    fun undefinedPrime() {
        expectedException.expect(IllegalArgumentException::class.java)
        expectedException.expectMessage("There is no zeroth prime.")

        Prime.nth(0)
    }

}

Version data entries

116 entries across 116 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.179 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.178 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.177 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.176 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.175 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.174 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.173 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.172 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.171 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.170 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.169 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.167 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.166 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.165 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.164 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.163 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.162 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.161 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt
trackler-2.2.1.160 tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt