Skip to content

Commit 3329eb4

Browse files
test: add some tests on room application services
1 parent 47adfd4 commit 3329eb4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/test/kotlin/application/service/ServiceTest.kt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,27 @@ class ServiceTest : StringSpec({
3232
result shouldNotBe null
3333
Service.GetRoom(exampleRoom.id, roomController).execute() shouldBe exampleRoom
3434
}
35+
36+
"I should be able to delete an existing room" {
37+
Service.CreateRoom(exampleRoom, roomController).execute()
38+
val result = Service.DeleteRoom(exampleRoom.id, roomController).execute()
39+
result shouldBe true
40+
Service.GetRoom(exampleRoom.id, roomController).execute() shouldBe null
41+
}
42+
43+
"If a room does not exist, then call delete on it result in a failed request" {
44+
val result = Service.DeleteRoom(exampleRoom.id, roomController).execute()
45+
result shouldBe false
46+
}
47+
48+
"I should be able to get the state of an existing room" {
49+
Service.CreateRoom(exampleRoom, roomController).execute()
50+
val result = Service.GetRoom(exampleRoom.id, roomController).execute()
51+
result shouldBe exampleRoom
52+
}
53+
54+
"If a room does not exist, a request on its state, must return null" {
55+
val result = Service.GetRoom(exampleRoom.id, roomController).execute()
56+
result shouldBe null
57+
}
3558
})

0 commit comments

Comments
 (0)