diff --git a/kotlin/src/main/kotlin/com/baeldung/kotlin/ItemService.kt b/kotlin/src/main/kotlin/com/baeldung/kotlin/ItemService.kt index 97360db822..1740fb2863 100644 --- a/kotlin/src/main/kotlin/com/baeldung/kotlin/ItemService.kt +++ b/kotlin/src/main/kotlin/com/baeldung/kotlin/ItemService.kt @@ -54,6 +54,7 @@ fun main(args: Array) { val sum = "four: ${2 + 2}" val itemManager = ItemManager("cat_id", "db://connection") + ItemManager(categoryId = "catId", dbConnection = "db://Connection") val result = "function result: ${itemManager.isFromSpecificCategory("1")}" println(result) diff --git a/kotlin/src/test/kotlin/com/baeldung/kotlin/LambdaTest.kt b/kotlin/src/test/kotlin/com/baeldung/kotlin/LambdaTest.kt new file mode 100644 index 0000000000..34217336a0 --- /dev/null +++ b/kotlin/src/test/kotlin/com/baeldung/kotlin/LambdaTest.kt @@ -0,0 +1,19 @@ +package com.baeldung.kotlin + +import org.junit.Test +import kotlin.test.assertEquals + + +class LambdaTest { + @Test + fun givenListOfNumber_whenDoingOperationsUsingLambda_shouldReturnProperResult() { + //given + val listOfNumbers = listOf(1, 2, 3) + + //when + val sum = listOfNumbers.reduce { a, b -> a + b } + + //then + assertEquals(6, sum) + } +} \ No newline at end of file