Sha256: 60bf8cd9917977ff43e91ec94f2eba33928fac9ba57b082b9a45dbb62af15463

Contents?: true

Size: 1.16 KB

Versions: 126

Compression:

Stored size: 1.16 KB

Contents

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

class DnaTest {

    @Test
    fun emptyDnaStringHasNoNucleotides() {
        val dna = Dna("")
        val expected = mapOf('A' to 0, 'C' to 0, 'G' to 0, 'T' to 0)

        assertEquals(expected, dna.nucleotideCounts)
    }

    @Ignore
    @Test
    fun canCountOneNucleotideInSingleCharacterInput() {
        val dna = Dna("G")
        val expected = mapOf('A' to 0, 'C' to 0, 'G' to 1, 'T' to 0)

        assertEquals(expected, dna.nucleotideCounts)
    }

    @Ignore
    @Test
    fun canCountRepeatedNucleotide() {
        val dna = Dna("GGGGGGG")
        val expected = mapOf('A' to 0, 'C' to 0, 'G' to 7, 'T' to 0)

        assertEquals(expected, dna.nucleotideCounts)
    }

    @Ignore
    @Test
    fun canCountMultipleNucleotides() {
        val dna = Dna("AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC")
        val expected = mapOf('A' to 20, 'C' to 12, 'G' to 17, 'T' to 21)

        assertEquals(expected, dna.nucleotideCounts)
    }

    @Ignore
    @Test(expected = IllegalArgumentException::class)
    fun validatesNucleotides() {
        Dna("AGXXACT")
    }

}

Version data entries

126 entries across 126 versions & 1 rubygems

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