Sha256: 8c2489bed228fcba220154ba8b6a7ee9f8b3ef0af6b2a2d58e503b8725520b8a

Contents?: true

Size: 1.28 KB

Versions: 129

Compression:

Stored size: 1.28 KB

Contents

import org.junit.Ignore
import org.junit.Test
import kotlin.test.assertEquals

class PrimeFactorCalculatorTest {

    @Test
    fun testThat1HasNoPrimeFactors() {
        assertEquals(emptyList(), PrimeFactorCalculator.primeFactors(1))
    }

    @Ignore
    @Test
    fun testThatAPrimeNumberHasExactlyOnePrimeFactor() {
        assertEquals(listOf(2), PrimeFactorCalculator.primeFactors(2))
    }

    @Ignore
    @Test
    fun testThatASquareOfAPrimeHasExactlyOnePrimeFactorRepeatedTwice() {
        assertEquals(listOf(3, 3), PrimeFactorCalculator.primeFactors(9))
    }

    @Ignore
    @Test
    fun testThatACubeOfAPrimeHasExactlyOnePrimeFactorRepeatedThreeTimes() {
        assertEquals(listOf(2, 2, 2), PrimeFactorCalculator.primeFactors(8))
    }

    @Ignore
    @Test
    fun testThatAProductOfPrimesAndNonPrimesIsFactoredProperly() {
        assertEquals(listOf(2, 2, 3), PrimeFactorCalculator.primeFactors(12))
    }

    @Ignore
    @Test
    fun testThatAProductOfSmallPrimesIsFactoredProperly() {
        assertEquals(listOf(5, 17, 23, 461), PrimeFactorCalculator.primeFactors(901255))
    }

    @Ignore
    @Test
    fun testThatAProductOfSmallAndLargePrimesIsFactoredProperly() {
        assertEquals(listOf<Long>(11, 9539, 894119), PrimeFactorCalculator.primeFactors(93819012551L))
    }

}

Version data entries

129 entries across 129 versions & 1 rubygems

Version Path
trackler-2.2.1.78 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.77 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.76 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.75 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.74 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.73 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.72 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.71 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.70 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.69 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.68 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.67 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.66 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.65 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.64 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.63 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.62 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.61 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.60 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.59 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt