Skip to content

Commit d3c5ed7

Browse files
test(application-service): test creation of a room
1 parent 122cbcc commit d3c5ed7

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2023. Smart Operating Block
3+
*
4+
* Use of this source code is governed by an MIT-style
5+
* license that can be found in the LICENSE file or at
6+
* https://opensource.org/licenses/MIT.
7+
*/
8+
9+
package application.service
10+
11+
import application.controller.RoomController
12+
import entity.zone.Room
13+
import entity.zone.RoomID
14+
import entity.zone.RoomType
15+
import entity.zone.ZoneID
16+
import infrastructure.digitaltwins.DigitalTwinManagerStub
17+
import io.kotest.core.spec.style.StringSpec
18+
import io.kotest.matchers.shouldBe
19+
import io.kotest.matchers.shouldNotBe
20+
21+
class ServiceTest : StringSpec({
22+
var roomController = RoomController(DigitalTwinManagerStub())
23+
val exampleRoom = Room(RoomID("r1"), RoomType.OPERATING_ROOM, ZoneID("z1"))
24+
25+
beforeEach {
26+
// Re-initalize the digital twin manager stub.
27+
roomController = RoomController(DigitalTwinManagerStub())
28+
}
29+
30+
"I should be able to create a room" {
31+
val result = Service.CreateRoom(exampleRoom, roomController).execute()
32+
result shouldNotBe null
33+
Service.GetRoom(exampleRoom.id, roomController).execute() shouldBe exampleRoom
34+
}
35+
})

0 commit comments

Comments
 (0)