Sha256: ecef14fbcda6d09db05816bc255d1783395cc883947660e41782f38a2d506e9d

Contents?: true

Size: 1.92 KB

Versions: 126

Compression:

Stored size: 1.92 KB

Contents

import org.junit.Ignore
import org.junit.Test

import org.junit.Assert.assertEquals

class NaturalNumberTest {

    @Test
    fun smallPerfectNumberIsClassifiedCorrectly() {
        assertEquals(Classification.PERFECT, classify(6))
    }

    @Ignore
    @Test
    fun mediumPerfectNumberIsClassifiedCorrectly() {
        assertEquals(Classification.PERFECT, classify(28))
    }

    @Ignore
    @Test
    fun largePerfectNumberIsClassifiedCorrectly() {
        assertEquals(Classification.PERFECT, classify(33550336))
    }

    @Ignore
    @Test
    fun smallAbundantNumberIsClassifiedCorrectly() {
        assertEquals(Classification.ABUNDANT, classify(12))
    }

    @Ignore
    @Test
    fun mediumAbundantNumberIsClassifiedCorrectly() {
        assertEquals(Classification.ABUNDANT, classify(30))
    }

    @Ignore
    @Test
    fun largeAbundantNumberIsClassifiedCorrectly() {
        assertEquals(Classification.ABUNDANT, classify(33550335))
    }

    @Ignore
    @Test
    fun smallestPrimeDeficientNumberIsClassifiedCorrectly() {
        assertEquals(Classification.DEFICIENT, classify(2))
    }

    @Ignore
    @Test
    fun smallestNonPrimeDeficientNumberIsClassifiedCorrectly() {
        assertEquals(Classification.DEFICIENT, classify(4))
    }

    @Ignore
    @Test
    fun mediumNumberIsClassifiedCorrectly() {
        assertEquals(Classification.DEFICIENT, classify(32))
    }

    @Ignore
    @Test
    fun largeDeficientNumberIsClassifiedCorrectly() {
        assertEquals(Classification.DEFICIENT, classify(33550337))
    }

    @Ignore
    @Test
    fun edgeCaseWithNoFactorsOtherThanItselfIsClassifiedCorrectly() {
        assertEquals(Classification.DEFICIENT, classify(1))
    }

    @Ignore
    @Test(expected = RuntimeException::class)
    fun zeroIsNotANaturalNumber() {
        classify(0)
    }

    @Ignore
    @Test(expected = RuntimeException::class)
    fun negativeNumberIsNotANaturalNumber() {
        classify(-1)
    }

}

Version data entries

126 entries across 126 versions & 1 rubygems

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