File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
src/test/kotlin/infrastructure/digitaltwins Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 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 infrastructure.digitaltwins
10+
11+ import application.controller.manager.RoomDigitalTwinManager
12+ import entity.zone.Room
13+ import entity.zone.RoomID
14+
15+ /* *
16+ * Simple Stub for [RoomDigitalTwinManager] in order to perform tests.
17+ */
18+ class DigitalTwinManagerStub : RoomDigitalTwinManager {
19+ private val roomList: MutableSet <Room > = mutableSetOf ()
20+
21+ override fun createRoomDigitalTwin (room : Room ): Boolean {
22+ this .roomList.add(room)
23+ return true
24+ }
25+
26+ override fun deleteRoomDigitalTwin (roomId : RoomID ): Boolean {
27+ return this .roomList.removeIf { it.id == roomId }
28+ }
29+
30+ override fun findBy (roomId : RoomID ): Room ? {
31+ return this .roomList.find { it.id == roomId }
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments