Skip to content

Commit 2f45ae4

Browse files
committed
#13 - Kotlin
1 parent 6006b69 commit 2f45ae4

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package main
2+
3+
import org.testng.AssertJUnit.assertEquals
4+
import org.testng.annotations.Test
5+
6+
/*
7+
* SUM
8+
*/
9+
10+
fun sum(num1: Int, num2: Int): Int {
11+
return num1 + num2
12+
}
13+
14+
class SumTest {
15+
@Test
16+
fun testSum() {
17+
assertEquals(42, sum(40, 2))
18+
}
19+
}
20+
21+
22+
/*
23+
* DICTIONARY
24+
* */
25+
26+
val data = mapOf(
27+
"name" to "Anna",
28+
"age" to "36",
29+
"birth_date" to "13 de octubre",
30+
"programming_languages" to listOf("Python", "Kotlin")
31+
)
32+
33+
class DictionaryTest {
34+
@Test
35+
fun testAllKeysExist() {
36+
val correctKeys = setOf("name", "age", "birth_date", "programming_languages")
37+
assertEquals(data.keys, correctKeys)
38+
}
39+
}

0 commit comments

Comments
 (0)