Added isError tests
This commit is contained in:
parent
c138971230
commit
bcdd8c10cf
2 changed files with 19 additions and 2 deletions
|
@ -56,7 +56,7 @@ open class Message @JvmOverloads constructor(
|
|||
/** Error flag. */
|
||||
var isError = isError
|
||||
set(value) {
|
||||
if (value) isNotice = value
|
||||
if (value) isNotice = true
|
||||
field = value
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ import assertk.assertions.isTrue
|
|||
import assertk.assertions.prop
|
||||
import org.testng.annotations.Test
|
||||
|
||||
class TestMessage {
|
||||
class MessageTest {
|
||||
@Test
|
||||
fun testConstructor() {
|
||||
var msg = Message("foo")
|
||||
|
@ -61,6 +61,23 @@ class TestMessage {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testIsError() {
|
||||
val msg = Message("foo")
|
||||
msg.isError = true
|
||||
assertThat(msg).all {
|
||||
prop(Message::isError).isTrue()
|
||||
prop(Message::isNotice).isTrue()
|
||||
prop(Message::isPrivate).isFalse()
|
||||
}
|
||||
msg.isError = false
|
||||
assertThat(msg).all {
|
||||
prop(Message::isError).isFalse()
|
||||
prop(Message::isNotice).isTrue()
|
||||
prop(Message::isPrivate).isFalse()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testNoticeMessage() {
|
||||
val msg = NoticeMessage("food")
|
Loading…
Add table
Add a link
Reference in a new issue