Stop notification listener when all logging is disabled
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
package se.ajpanton.notificationlog.settings
|
||||
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class NotificationListenerPolicyTest {
|
||||
@Test fun `listener runs when any logging type is enabled`() {
|
||||
assertTrue(NotificationListenerPolicy.shouldRun(listOf(LoggingRule(enabled = false), LoggingRule(enabled = true))))
|
||||
}
|
||||
|
||||
@Test fun `listener stays off when every logging type is disabled`() {
|
||||
assertFalse(NotificationListenerPolicy.shouldRun(LoggingType.entries.map { LoggingRule(enabled = false) }))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user