Skip to content

Commit ad86c5f

Browse files
committed
tp6 step 3
1 parent f5acacf commit ad86c5f

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package fmt.kotlin.fundamentals
2+
3+
class InventoryService {
4+
val bottles = mutableListOf<Bottle>()
5+
6+
val errors = mutableListOf<String>()
7+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package fmt.kotlin.fundamentals
2+
3+
import org.junit.jupiter.api.Assertions.*
4+
import strikt.api.expectThat
5+
import strikt.assertions.isEqualTo
6+
import kotlin.test.Test
7+
8+
class InventoryServiceTest {
9+
10+
@Test
11+
fun `should add 3 bottles`() {
12+
val service = InventoryService()
13+
14+
service.addAll(listOf(
15+
"Bouteille de Coucheroy de 2005",
16+
"Bouteille de Coucheroy",
17+
"Bouteille de Pedesclaux de 2009",
18+
"Bouteille de Talbot de 2015",
19+
))
20+
21+
expectThat(service.bottles.toList()).isEqualTo(
22+
listOf(
23+
Bottle("Coucheroy", 2005),
24+
Bottle("Pedesclaux", 2009),
25+
Bottle("Talbot", 2015),
26+
)
27+
)
28+
}
29+
}

0 commit comments

Comments
 (0)