Reorder tests

This commit is contained in:
Benoit Marty 2020-02-07 15:35:09 +01:00
parent 8bdb2b88fd
commit 9df699db59

View File

@ -31,6 +31,10 @@ import org.junit.Test
class PushrulesConditionTest {
/* ==========================================================================================
* Test EventMatchCondition
* ========================================================================================== */
@Test
fun test_eventmatch_type_condition() {
val condition = EventMatchCondition("type", "m.room.message")
@ -120,6 +124,24 @@ class PushrulesConditionTest {
assert(condition.isSatisfied(simpleTextEvent))
}
@Test
fun test_notice_condition() {
val conditionEqual = EventMatchCondition("content.msgtype", "m.notice")
Event(
type = "m.room.message",
eventId = "mx0",
content = MessageTextContent("m.notice", "A").toContent(),
originServerTs = 0,
roomId = "2joined").also {
assertTrue("Notice", conditionEqual.isSatisfied(it))
}
}
/* ==========================================================================================
* Test RoomMemberCountCondition
* ========================================================================================== */
@Test
fun test_roommember_condition() {
val conditionEqual3 = RoomMemberCountCondition("3")
@ -164,18 +186,4 @@ class PushrulesConditionTest {
assertFalse("This room has more than 3 members", conditionLessThan3.isSatisfied(it, roomGetterStub))
}
}
@Test
fun test_notice_condition() {
val conditionEqual = EventMatchCondition("content.msgtype", "m.notice")
Event(
type = "m.room.message",
eventId = "mx0",
content = MessageTextContent("m.notice", "A").toContent(),
originServerTs = 0,
roomId = "2joined").also {
assertTrue("Notice", conditionEqual.isSatisfied(it))
}
}
}