Sha256: 8187486c5099e71c3af12c5a086f516c2826bcb151de78cf7bdd9977503706c4

Contents?: true

Size: 1.7 KB

Versions: 126

Compression:

Stored size: 1.7 KB

Contents

import org.junit.Test
import org.junit.Ignore
import org.junit.experimental.runners.Enclosed
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import kotlin.test.assertEquals

@RunWith(Enclosed::class)
class AtbashTest {

    @RunWith(Parameterized::class)
    class EncodeTest(val input: String, val expectedOutput: String) {

        companion object {
            @JvmStatic
            @Parameterized.Parameters
            fun data() = listOf(
                    arrayOf("yes", "bvh"),
                    arrayOf("no", "ml"),
                    arrayOf("OMG", "lnt"),
                    arrayOf("O M G", "lnt"),
                    arrayOf("mindblowingly", "nrmwy oldrm tob"),
                    arrayOf("Testing,1 2 3, testing.", "gvhgr mt123 gvhgr mt"),
                    arrayOf("Truth is fiction.", "gifgs rhurx grlm"),
                    arrayOf("The quick brown fox jumps over the lazy dog.", "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt")
            )
        }

        @Test
        fun test() {
            assertEquals(expectedOutput, Atbash.encode(input))
        }

    }

    @RunWith(Parameterized::class)
    class DecodeTest(val input: String, val expectedOutput: String) {

        companion object {
            @JvmStatic
            @Parameterized.Parameters
            fun data() = listOf(
                    arrayOf("vcvix rhn", "exercism"),
                    arrayOf("zmlyh gzxov rhlug vmzhg vkkrm thglm v", "anobstacleisoftenasteppingstone"),
                    arrayOf("gvhgr mt123 gvhgr mt", "testing123testing")
            )
        }

        @Ignore
        @Test
        fun test() {
            assertEquals(expectedOutput, Atbash.decode(input))
        }

    }

}

Version data entries

126 entries across 126 versions & 1 rubygems

Version Path
trackler-2.2.1.159 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.158 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.157 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.156 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.155 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.154 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.153 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.152 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.151 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.150 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.149 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.148 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.147 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.146 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.145 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.144 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.143 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.142 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.141 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.2.1.140 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt