Sha256: 6ae7008f6747304082b41d888f071a0f42d2fa7b483e2e65d4b1bfbead3118c0

Contents?: true

Size: 1.31 KB

Versions: 59

Compression:

Stored size: 1.31 KB

Contents

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

/*
 * version: 1.0.0
 */
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

59 entries across 59 versions & 1 rubygems

Version Path
trackler-2.2.1.49 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.48 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.47 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.46 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.45 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.44 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.43 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.42 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.41 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.40 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.39 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.38 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.37 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.36 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.35 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.34 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.33 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.32 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.31 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
trackler-2.2.1.30 tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt