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-1.0.4.0 tracks/kotlin/exercises/hello-world/src/test/kotlin/HelloWorldTest.kt
trackler-1.0.3.0 tracks/kotlin/exercises/hello-world/src/test/kotlin/HelloWorldTest.kt
trackler-1.0.2.1 tracks/kotlin/exercises/hello-world/src/test/kotlin/HelloWorldTest.kt
trackler-1.0.2.0 tracks/kotlin/exercises/hello-world/src/test/kotlin/HelloWorldTest.kt
trackler-1.0.1.2 tracks/kotlin/exercises/hello-world/src/test/kotlin/HelloWorldTest.kt
trackler-1.0.1.1 tracks/kotlin/exercises/hello-world/src/test/kotlin/HelloWorldTest.kt
trackler-1.0.1.0 tracks/kotlin/exercises/hello-world/src/test/kotlin/HelloWorldTest.kt
trackler-1.0.0.1 tracks/kotlin/exercises/hello-world/src/test/kotlin/HelloWorldTest.kt
trackler-1.0.0 tracks/kotlin/exercises/hello-world/src/test/kotlin/HelloWorldTest.kt