File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
main/kotlin/fmt/kotlin/fundamentals
test/kotlin/fmt/kotlin/fundamentals Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ package fmt.kotlin.fundamentals
2
+
3
+ class InventoryService {
4
+ val bottles = mutableListOf<Bottle >()
5
+
6
+ val errors = mutableListOf<String >()
7
+ }
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments