コード例 #1
0
        public void ToolBarVisibilityChangedShouldBeRaisedWhenToolBarVisibilityChanges()
        {
            const string siteName   = "siteName";
            var          cabCommand = new Command();
            var          command    = _commandService.CreateCommand(cabCommand, "command", null);

            _toolBarService.AddButtonItem(siteName, command, null, null);
            Assert.IsNull(_toolBarVisibilityChangedEventArgs);

            _toolBarService.SetIsVisible(siteName, false);
            Assert.IsNotNull(_toolBarVisibilityChangedEventArgs);
            Assert.AreEqual(siteName, _toolBarVisibilityChangedEventArgs.ToolBarSiteName);

            ClearEventInfo();
            _toolBarService.SetIsVisible(siteName, false);
            Assert.IsNull(_toolBarVisibilityChangedEventArgs);

            ClearEventInfo();
            _toolBarService.SetIsVisible(siteName, true);
            Assert.IsNotNull(_toolBarVisibilityChangedEventArgs);
            Assert.AreEqual(siteName, _toolBarVisibilityChangedEventArgs.ToolBarSiteName);
        }