mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Reorder tests
This commit is contained in:
parent
8bdb2b88fd
commit
9df699db59
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user