Sha256: 0dfe412383c3246f9406fa86db8fbab1ef2287b7ebc821e5d551dad9e2cca9a1

Contents?: true

Size: 1.61 KB

Versions: 89

Compression:

Stored size: 1.61 KB

Contents

import org.junit.Test
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("no", "ml"),
                    arrayOf("yes", "bvh"),
                    arrayOf("OMG", "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")
            )
        }

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

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
trackler-2.0.6.33 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.32 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.31 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.30 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.29 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.28 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.27 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.26 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.25 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.24 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.23 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.22 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.21 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.20 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.19 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.18 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.17 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.16 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.15 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt
trackler-2.0.6.14 tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt