Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4e3955d authored by Eduard Dumitrescul's avatar Eduard Dumitrescul
Browse files

Added tests for MostRestrictive#isPolicyApplied()

Bug: 285532044

Test: atest ResolutionMechanismTests

Flag: TEST_ONLY
Change-Id: I9521da3eca0ee9931eda2e79a920883fe6c6fb4a
parent 01623534
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -243,6 +243,24 @@ class ResolutionMechanismTest {
        }
    }

    @Test
    fun isPolicyApplied_mostRestrictive_sameValues_returnsTrue() {
        val resolutionMechanism = MostRestrictive<Int>(listOf())

        assertTrue {
            resolutionMechanism.isPolicyApplied(INT_POLICY_A, INT_POLICY_A)
        }
    }

    @Test
    fun isPolicyApplied_mostRestrictive_differentValues_returnsFalse() {
        val resolutionMechanism = MostRestrictive<Int>(listOf())

        assertFalse {
            resolutionMechanism.isPolicyApplied(INT_POLICY_A, INT_POLICY_AB )
        }
    }

    companion object {
        private const val SYSTEM_USER_ID = UserHandle.USER_SYSTEM
        private val SYSTEM_ADMIN = EnforcingAdmin.createSystemEnforcingAdmin("system_entity")