Beispiel #1
0
        public void VerifyThatCommandsCallNavigationService()
        {
            var ribbon1 = new CategoryRibbonViewModel();
            var ribbon2 = new MeasurementScalesRibbonViewModel();
            var ribbon3 = new MeasurementUnitsRibbonViewModel();
            var ribbon4 = new RulesRibbonViewModel();
            var ribbon5 = new ParameterTypeRibbonViewModel();

            CDPMessageBus.Current.SendMessage(new SessionEvent(this.session.Object, SessionStatus.Open));

            ribbon1.OpenSingleBrowserCommand.Execute(null);
            ribbon2.OpenSingleBrowserCommand.Execute(null);
            ribbon3.OpenSingleBrowserCommand.Execute(null);
            ribbon4.OpenSingleBrowserCommand.Execute(null);
            ribbon5.OpenSingleBrowserCommand.Execute(null);

            this.navigation.Verify(x => x.Open(It.IsAny <IPanelViewModel>(), true), Times.Exactly(5));

            ribbon1.OpenSingleBrowserCommand.Execute(null);
            ribbon2.OpenSingleBrowserCommand.Execute(null);
            ribbon3.OpenSingleBrowserCommand.Execute(null);
            ribbon4.OpenSingleBrowserCommand.Execute(null);
            ribbon5.OpenSingleBrowserCommand.Execute(null);

            this.navigation.Verify(x => x.Close(It.IsAny <IPanelViewModel>(), true), Times.Exactly(5));
        }
Beispiel #2
0
        public void VerifyThatInstantiatePanelViewModelReturnsExpectedViewModel()
        {
            var viewmodel = MeasurementUnitsRibbonViewModel.InstantiatePanelViewModel(
                this.session.Object,
                this.thingDialogNavigationService.Object,
                this.panelNavigationService.Object,
                this.dialogNavigationService.Object,
                this.pluginSettingsService.Object);

            Assert.IsInstanceOf <MeasurementUnitsBrowserViewModel>(viewmodel);
        }
Beispiel #3
0
        public void VerifyThatCommandDontDoAnythingWithoutOpenSession()
        {
            var ribbon1 = new CategoryRibbonViewModel();
            var ribbon2 = new MeasurementScalesRibbonViewModel();
            var ribbon3 = new MeasurementUnitsRibbonViewModel();
            var ribbon4 = new RulesRibbonViewModel();
            var ribbon5 = new ParameterTypeRibbonViewModel();

            ribbon1.OpenSingleBrowserCommand.Execute(null);
            ribbon2.OpenSingleBrowserCommand.Execute(null);
            ribbon3.OpenSingleBrowserCommand.Execute(null);
            ribbon4.OpenSingleBrowserCommand.Execute(null);
            ribbon5.OpenSingleBrowserCommand.Execute(null);

            this.navigation.Verify(x => x.Open(It.IsAny <IPanelViewModel>(), true), Times.Never());
            this.navigation.Verify(x => x.Close(It.IsAny <IPanelViewModel>(), true), Times.Never());
        }
Beispiel #4
0
        public void VerifyThatCloseSessionEventAreCaught()
        {
            var ribbon1 = new CategoryRibbonViewModel();
            var ribbon2 = new MeasurementScalesRibbonViewModel();
            var ribbon3 = new MeasurementUnitsRibbonViewModel();
            var ribbon4 = new RulesRibbonViewModel();
            var ribbon5 = new ParameterTypeRibbonViewModel();

            CDPMessageBus.Current.SendMessage(new SessionEvent(this.session.Object, SessionStatus.Open));
            CDPMessageBus.Current.SendMessage(new SessionEvent(this.session.Object, SessionStatus.Closed));

            Assert.AreEqual(0, ribbon1.OpenSessions.Count);
            Assert.AreEqual(0, ribbon2.OpenSessions.Count);
            Assert.AreEqual(0, ribbon3.OpenSessions.Count);
            Assert.AreEqual(0, ribbon4.OpenSessions.Count);
            Assert.AreEqual(0, ribbon5.OpenSessions.Count);
        }