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.6.33 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.32 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.31 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.30 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.29 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.28 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.27 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.26 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.25 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.24 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.23 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.22 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.21 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.20 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.19 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.18 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.17 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.16 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.15 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt
trackler-2.0.6.14 tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt