File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
src/test/kotlin/application/service Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -145,4 +145,35 @@ class RoomServiceTest : StringSpec({
145145 ).execute() shouldBe false
146146 }
147147 }
148+
149+ " It should be possible to extract the historical room environmental data of an existing room" {
150+ withMongo {
151+ val roomController = controller()
152+ RoomService .CreateRoom (exampleRoom, roomController).execute()
153+ RoomService .UpdateRoomEnvironmentData (
154+ exampleRoom.id,
155+ RoomEnvironmentalData (humidity = Humidity (55.0)),
156+ Instant .now().minus(1, ChronoUnit .DAYS ),
157+ roomController
158+ ).execute()
159+ RoomService .ExportRoomEnvironmentalData (
160+ exampleRoom.id,
161+ roomController,
162+ Instant .now().minus(2, ChronoUnit .DAYS ),
163+ Instant .now()
164+ ).execute()?.size shouldBe 1
165+ }
166+ }
167+
168+ " It should not be possible to extract historical room environmental data of a room that doesn't exist" {
169+ withMongo {
170+ val roomController = controller()
171+ RoomService .ExportRoomEnvironmentalData (
172+ exampleRoom.id,
173+ roomController,
174+ Instant .now().minus(2, ChronoUnit .DAYS ),
175+ Instant .now()
176+ ).execute() shouldBe null
177+ }
178+ }
148179})
You can’t perform that action at this time.
0 commit comments