public void AssertThatRefreshCommandWorks()
        {
            var browser = new BrowserTestClass(this.siteDir, this.session.Object, this.dialogNavigation.Object, this.navigation.Object, null, null);

            Assert.DoesNotThrow(() => browser.RefreshCommand.Execute(null));
            session.Verify(session => session.Refresh());
        }
Example #2
0
        public void AssertThatSelectingARowCallsNavigationService()
        {
            var browser = new BrowserTestClass(this.siteDir, this.session.Object, this.dialogNavigation.Object, this.navigation.Object, null, null);

            browser.SelectedThing = new RowTestClass(this.person, this.session.Object, this.dialogNavigation.Object);

            this.navigation.Verify(x => x.Open(It.IsAny <Person>(), this.session.Object));
        }
        public void AssertThatCreateCommandWorks()
        {
            var browser = new BrowserTestClass(this.siteDir, this.session.Object, this.dialogNavigation.Object, this.navigation.Object, null, null);

            browser.CreateCommand.Execute(null);


            this.dialogNavigation.Verify(x => x.Navigate(It.IsAny <Thing>(), It.IsAny <IThingTransaction>(), this.session.Object, true, ThingDialogKind.Create, this.dialogNavigation.Object, It.IsAny <Thing>(), null));
        }
        public void AssertThatInspectCommandWorks()
        {
            var browser = new BrowserTestClass(this.siteDir, this.session.Object, this.dialogNavigation.Object, this.navigation.Object, null, null);

            Assert.IsFalse(browser.UpdateCommand.CanExecute(null));

            browser.SelectedThing = new RowTestClass(this.person, this.session.Object, this.dialogNavigation.Object);
            browser.InspectCommand.Execute(null);
            this.dialogNavigation.Verify(x => x.Navigate(It.IsAny <Thing>(), It.IsAny <IThingTransaction>(), this.session.Object, true, ThingDialogKind.Inspect, this.dialogNavigation.Object, It.IsAny <Thing>(), null));
        }
        public void AssertThatSelectingARowCallsCDPMessageBus()
        {
            var browser = new BrowserTestClass(this.siteDir, this.session.Object, this.dialogNavigation.Object, this.navigation.Object, null, null);

            var selectedThingChangedRaised = false;

            CDPMessageBus.Current.Listen <SelectedThingChangedEvent>().Subscribe(_ => selectedThingChangedRaised = true);

            browser.SelectedThing = new RowTestClass(this.person, this.session.Object, this.dialogNavigation.Object);

            Assert.IsTrue(selectedThingChangedRaised);
        }
        public void VerifyThatDeprecateCommandWorks()
        {
            this.permmissionService.Setup(x => x.CanWrite(It.IsAny <Thing>())).Returns(true);
            var browser = new BrowserTestClass(this.siteDir, this.session.Object, this.dialogNavigation.Object, this.navigation.Object, null, null);

            Assert.IsFalse(browser.DeprecateCommand.CanExecute(null));
            browser.SelectedThing = new RowTestClass(this.person, this.session.Object, this.dialogNavigation.Object);

            browser.ComputePermission();

            Assert.IsTrue(browser.DeprecateCommand.CanExecute(null));
            browser.DeprecateCommand.Execute(null);

            this.session.Verify(x => x.Write(It.IsAny <OperationContainer>()));
        }
        public void AssertThatHelpCommandWorks()
        {
            var browser = new BrowserTestClass(this.siteDir, this.session.Object, this.dialogNavigation.Object, this.navigation.Object, null, null);

            Assert.DoesNotThrow(() => browser.HelpCommand.Execute(null));
        }