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

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

Added tests for TopPriority#isPolicyApplied

Bug: 285532044

Test: atest ResolutionMechanismTest

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


    @Test
    fun isPolicyApplied_topPriority_sameValues_returnsTrue() {
        val resolutionMechanism = TopPriority<Int>(listOf())

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

    @Test
    fun isPolicyApplied_topPriority_differentValues_returnsFalse() {
        val resolutionMechanism = TopPriority<Int>(listOf())

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



    companion object {
    companion object {
        private const val SYSTEM_USER_ID = UserHandle.USER_SYSTEM
        private const val SYSTEM_USER_ID = UserHandle.USER_SYSTEM