Sha256: e687c0a6a2299705871d49e0643996185e42ec23951e5f45c49185d83a72152a

Contents?: true

Size: 1.17 KB

Versions: 89

Compression:

Stored size: 1.17 KB

Contents

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

class SquaresTest {

    @Test
    fun squareOfSum5() {
        assertEquals(225, Squares(5).squareOfSum())
    }

    @Test
    fun squareOfSum10() {
        assertEquals(3025, Squares(10).squareOfSum())
    }

    @Test
    fun squareOfSum100() {
        assertEquals(25502500, Squares(100).squareOfSum())
    }

    @Test
    fun sumOfSquares5() {
        assertEquals(55, Squares(5).sumOfSquares())
    }

    @Test
    fun sumOfSquares10() {
        assertEquals(385, Squares(10).sumOfSquares())
    }

    @Test
    fun sumOfSquares100() {
        assertEquals(338350, Squares(100).sumOfSquares())
    }

    @Test
    fun differenceOfSquares0() {
        assertEquals(0, Squares(0).difference())
    }

    @Test
    fun differenceOfSquares5() {
        assertEquals(170, Squares(5).difference())
    }

    @Test
    fun differenceOfSquares10() {
        assertEquals(2640, Squares(10).difference())
    }

    @Test
    fun differenceOfSquares100() {
        assertEquals(25164150, Squares(100).difference())
    }

    @Test
    fun consistentDifference() {
        assertEquals(Squares(0).difference(), Squares(0).difference())
    }

}

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
trackler-2.0.5.12 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.5.11 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.5.10 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.5.9 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.5.8 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.5.7 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.5.6 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.5.5 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.5.4 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.5.3 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.5.2 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.5.1 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.5.0 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.4.0 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.3.9 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.3.8 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.3.7 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.3.6 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.3.5 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.3.4 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt