forked from igorwojda/kotlin-coding-challenges
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchallenge.kt
30 lines (24 loc) · 787 Bytes
/
challenge.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.igorwojda.string.getduplicatedarguments
import org.amshove.kluent.shouldBeEqualTo
import org.junit.jupiter.api.Test
fun getDuplicatedArguments(vararg strings: String): List<String>? {
TODO("not implemented")
}
private class Test {
@Test
fun `a, b, c returns empty list`() {
getDuplicatedArguments("a", "b", "c") shouldBeEqualTo listOf()
}
@Test
fun `a, b, c, a returns a`() {
getDuplicatedArguments("a", "b", "c", "a") shouldBeEqualTo listOf("a")
}
@Test
fun `a, e, a, e, d, a returns a, e`() {
getDuplicatedArguments("a", "e", "a", "e", "d", "a") shouldBeEqualTo listOf("a", "e")
}
@Test
fun `no arguments returns empty list`() {
getDuplicatedArguments() shouldBeEqualTo listOf()
}
}