Sha256: 3e56c3aeb09fe31db0d93cae08d84991856dd8cfb856b78c173f1f2ad17f67af

Contents?: true

Size: 1.92 KB

Versions: 54

Compression:

Stored size: 1.92 KB

Contents

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

/*
 * version: 1.0.0
 */
class RotationalCipherTest {

    @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 testRotateLowercaseABy0() {
        val cipher = RotationalCipher(0)
        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

54 entries across 54 versions & 1 rubygems

Version Path
trackler-2.2.1.49 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.48 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.47 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.46 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.45 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.44 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.43 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.42 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.41 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.40 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.39 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.38 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.37 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.36 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.35 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.34 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.33 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.32 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.31 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt
trackler-2.2.1.30 tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt