Skip to content

Commit

Permalink
test: add some tests on room application services
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaGiulianelli committed Feb 23, 2023
1 parent 47adfd4 commit 3329eb4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/test/kotlin/application/service/ServiceTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,27 @@ class ServiceTest : StringSpec({
result shouldNotBe null
Service.GetRoom(exampleRoom.id, roomController).execute() shouldBe exampleRoom
}

"I should be able to delete an existing room" {
Service.CreateRoom(exampleRoom, roomController).execute()
val result = Service.DeleteRoom(exampleRoom.id, roomController).execute()
result shouldBe true
Service.GetRoom(exampleRoom.id, roomController).execute() shouldBe null
}

"If a room does not exist, then call delete on it result in a failed request" {
val result = Service.DeleteRoom(exampleRoom.id, roomController).execute()
result shouldBe false
}

"I should be able to get the state of an existing room" {
Service.CreateRoom(exampleRoom, roomController).execute()
val result = Service.GetRoom(exampleRoom.id, roomController).execute()
result shouldBe exampleRoom
}

"If a room does not exist, a request on its state, must return null" {
val result = Service.GetRoom(exampleRoom.id, roomController).execute()
result shouldBe null
}
})

0 comments on commit 3329eb4

Please sign in to comment.