Sha256: cb1bdf13d51c888afe79ee3dce60cf1bb2791765a476d629a676551ccdcc023a

Contents?: true

Size: 1.11 KB

Versions: 181

Compression:

Stored size: 1.11 KB

Contents

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

class PascalsTriangleTest {


    @Test
    fun triangleWithFourRows() {
        val expectedOutput = listOf(
                listOf(1),
                listOf(1, 1),
                listOf(1, 2, 1),
                listOf(1, 3, 3, 1)
        )

        assertEquals(expectedOutput, PascalsTriangle.computeTriangle(4))
    }

    @Ignore
    @Test
    fun triangleWithSixRows() {
        val expectedOutput = listOf(
                listOf(1),
                listOf(1, 1),
                listOf(1, 2, 1),
                listOf(1, 3, 3, 1),
                listOf(1, 4, 6, 4, 1),
                listOf(1, 5, 10, 10, 5, 1)
        )

        assertEquals(expectedOutput, PascalsTriangle.computeTriangle(6))
    }

    @Ignore
    @Test
    fun expectEmptyTriangle() {
        val expectedOutput = emptyList<List<Int>>()

        assertEquals(expectedOutput, PascalsTriangle.computeTriangle(0))
    }

    @Ignore
    @Test(expected = IllegalArgumentException::class)
    fun validatesNotNegativeRows() {
        PascalsTriangle.computeTriangle(-1)
    }
}

Version data entries

181 entries across 181 versions & 1 rubygems

Version Path
trackler-2.2.1.52 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.51 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.50 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.49 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.48 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.47 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.46 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.45 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.44 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.43 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.42 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.41 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.40 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.39 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.38 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.37 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.36 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.35 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.34 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt
trackler-2.2.1.33 tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt