Test isVotable function.

This commit is contained in:
Onuray Sahin 2022-06-22 17:18:17 +03:00
parent a7bc2ef3bc
commit 2be43e9294

View File

@ -265,4 +265,18 @@ class PollItemFactoryTest {
}
}
}
@Test
fun `given a poll state when it is not Sending and not Ended then the poll is votable`() = runTest {
val sendingPollState = PollState.Sending
sendingPollState.isVotable() shouldBe false
val readyPollState = PollState.Ready
readyPollState.isVotable() shouldBe true
val votedPollState = PollState.Voted(1)
votedPollState.isVotable() shouldBe true
val undisclosedPollState = PollState.Undisclosed
undisclosedPollState.isVotable() shouldBe true
var endedPollState = PollState.Ended
endedPollState.isVotable() shouldBe false
}
}