Sha256: 2902acbfba5d0ddfd9a8224617c9b5c2dbfe61d0ce29b53ef158d7c87ef17b28

Contents?: true

Size: 757 Bytes

Versions: 89

Compression:

Stored size: 757 Bytes

Contents

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

class HelloWorldTest {

    @Test
    fun helloNoName() {
        assertEquals("Hello, World!", HelloWorld.hello())
    }

    @Test
    fun helloBlankName() {
        assertEquals("Hello, World!", HelloWorld.hello(""))
        assertEquals("Hello, World!", HelloWorld.hello("    "))
    }

    @Test
    fun helloNullName() {
        //This isn't advised in Kotlin but demonstrates the null safety in Kotlin
        assertEquals("Hello, World!", HelloWorld.hello(null))
    }

    @Test
    fun helloSampleName() {
        assertEquals("Hello, Alice!", HelloWorld.hello("Alice"))
    }

    @Test
    fun helloAnotherSampleName() {
        assertEquals("Hello, Bob!", HelloWorld.hello("Bob"))
    }
}

Version data entries

89 entries across 89 versions & 1 rubygems

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