Example #1
0
        public void EvaluateFalse_FromFalseAndWithCommandSetNull()
        {
            MainMenuTab mainMenuTab = CreateMainMenuTabWithoutCommand();

            mainMenuTab.IsDisabled = true;

            bool isEnabled = mainMenuTab.EvaluateEnabled();

            Assert.That(isEnabled, Is.False);
        }
Example #2
0
        public void EvaluateFalse_FromFalse()
        {
            MainMenuTab mainMenuTab = CreateMainMenuTab();

            mainMenuTab.IsDisabled = true;
            _mocks.ReplayAll();

            bool isEnabled = mainMenuTab.EvaluateEnabled();

            _mocks.VerifyAll();
            Assert.That(isEnabled, Is.False);
        }
Example #3
0
        public void EvaluateTrue_FromTrueAndWithAccessGranted()
        {
            MainMenuTab mainMenuTab = CreateMainMenuTab();

            mainMenuTab.IsDisabled = false;
            Expect.Call(_mockNavigationCommand.HasAccess(null)).Return(true);
            _mocks.ReplayAll();

            bool isEnabled = mainMenuTab.EvaluateEnabled();

            _mocks.VerifyAll();
            Assert.That(isEnabled, Is.True);
        }
Example #4
0
        public void EvaluateFalse_FromFalseAndWithMissingPermissionBehaviorSetToInvisible()
        {
            MainMenuTab mainMenuTab = CreateMainMenuTab();

            mainMenuTab.MissingPermissionBehavior = MissingPermissionBehavior.Invisible;
            mainMenuTab.IsDisabled = true;
            Expect.Call(_mockNavigationCommand.HasAccess(null)).Repeat.Never();
            _mocks.ReplayAll();

            bool isEnabled = mainMenuTab.EvaluateEnabled();

            _mocks.VerifyAll();
            Assert.That(isEnabled, Is.False);
        }