public void VerifyThatITerationEventAreCaught()
        {
            var vm           = new HtmlExportRibbonViewModel();
            var sessionEvent = new SessionEvent(this.session.Object, SessionStatus.Open);

            CDPMessageBus.Current.SendMessage(sessionEvent);

            this.session.Setup(x => x.DataSourceUri).Returns(this.uri.ToString);
            CDPMessageBus.Current.SendObjectChangeEvent(this.iteration, EventKind.Added);

            CDPMessageBus.Current.SendObjectChangeEvent(this.iteration, EventKind.Removed);

            Assert.AreEqual(0, vm.Iterations.Count);
        }
        public void VerifyThatExportCommandIsExecuted()
        {
            var vm           = new HtmlExportRibbonViewModel();
            var sessionEvent = new SessionEvent(this.session.Object, SessionStatus.Open);

            CDPMessageBus.Current.SendMessage(sessionEvent);

            this.session.Setup(x => x.DataSourceUri).Returns(this.uri.ToString);
            CDPMessageBus.Current.SendObjectChangeEvent(this.iteration, EventKind.Added);

            vm.ExportCommand.Execute(null);

            this.dialogNavigationService.Verify(x => x.NavigateModal(It.IsAny <HtmlExportRequirementsSpecificationSelectionDialogViewModel>()));
        }
        public void VerifyThatSessionEventsAreCaught()
        {
            var vm           = new HtmlExportRibbonViewModel();
            var sessionEvent = new SessionEvent(this.session.Object, SessionStatus.Open);

            CDPMessageBus.Current.SendMessage(sessionEvent);

            Assert.AreEqual(1, vm.Sessions.Count);

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

            Assert.AreEqual(0, vm.Sessions.Count);
        }
        public void VerifyThatExportCommandIsEnabledAndDisabled()
        {
            var vm           = new HtmlExportRibbonViewModel();
            var sessionEvent = new SessionEvent(this.session.Object, SessionStatus.Open);

            CDPMessageBus.Current.SendMessage(sessionEvent);

            Assert.IsFalse(vm.ExportCommand.CanExecute(null));

            this.session.Setup(x => x.DataSourceUri).Returns(this.uri.ToString);
            CDPMessageBus.Current.SendObjectChangeEvent(this.iteration, EventKind.Added);

            Assert.IsTrue(vm.ExportCommand.CanExecute(null));
        }
        public void VerifyThatIterationEventAreCaughtFailed()
        {
            var vm = new HtmlExportRibbonViewModel();

            Assert.Throws <InvalidOperationException>(() => CDPMessageBus.Current.SendObjectChangeEvent(this.iteration, EventKind.Added));
        }