Sha256: 608e329db629f8f64199e1398e0f376a8a41652956cc372e74269830ba1835a9

Contents?: true

Size: 1.89 KB

Versions: 126

Compression:

Stored size: 1.89 KB

Contents

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

class RotationalCipherTest {

    @Test
    fun testRotateLowercaseABy0() {
        val cipher = RotationalCipher(0)
        assertEquals("a", cipher.encode("a"))
    }

    @Ignore
    @Test
    fun testRotateLowercaseABy1NoWrapAround() {
        val cipher = RotationalCipher(1)
        assertEquals("b", cipher.encode("a"))
    }

    @Ignore
    @Test
    fun testRotateLowercaseABy26SingleWrapAround() {
        val cipher = RotationalCipher(26)
        assertEquals("a", cipher.encode("a"))
    }

    @Ignore
    @Test
    fun testRotateLowercaseMBy13NoWrapAround() {
        val cipher = RotationalCipher(13)
        assertEquals("z", cipher.encode("m"))
    }

    @Ignore
    @Test
    fun testRotateLowercaseNBy1SingleWrapAround() {
        val cipher = RotationalCipher(13)
        assertEquals("a", cipher.encode("n"))
    }

    @Ignore
    @Test
    fun testRotateCapitalLettersNoWrapAround() {
        val cipher = RotationalCipher(5)
        assertEquals("TRL", cipher.encode("OMG"))
    }

    @Ignore
    @Test
    fun testSpacesAreUnalteredByRotation() {
        val cipher = RotationalCipher(5)
        assertEquals("T R L", cipher.encode("O M G"))
    }

    @Ignore
    @Test
    fun testNumbersAreUnalteredByRotation() {
        val cipher = RotationalCipher(4)
        assertEquals("Xiwxmrk 1 2 3 xiwxmrk", cipher.encode("Testing 1 2 3 testing"))
    }

    @Ignore
    @Test
    fun testPunctuationIsUnalteredByRotation() {
        val cipher = RotationalCipher(21)
        assertEquals("Gzo'n zvo, Bmviyhv!", cipher.encode("Let's eat, Grandma!"))
    }

    @Ignore
    @Test
    fun testAllLettersRotateCorrectly() {
        val cipher = RotationalCipher(13)
        assertEquals(
                "Gur dhvpx oebja sbk whzcf bire gur ynml qbt.",
                cipher.encode("The quick brown fox jumps over the lazy dog."))
    }

}

Version data entries

126 entries across 126 versions & 1 rubygems

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