Exemplo n.º 1
0
        public void DuplicateCancelBodyReferenceDialog()
        {
            TestDataGenerator.GenerateBodyReference(MainWindow);
            MainWindow.Ribbon.SelectGroup("Edit");
            Assert.IsTrue(MainWindow.Ribbon.IsButtonEnabled("Duplicate"));
            MainWindow.Ribbon.ClickButton("Duplicate");

            var dlg = new TaskDialogAdaptor(MainWindow);

            Assert.That(dlg, Is.Not.Null);
            Assert.That(dlg.Title, Is.EqualTo("Foreign Body References"));
            dlg.Close();

            // Check that box is not duplicated
            Assert.AreEqual(2, MainWindow.Document.GetBodyItems().Count());
        }
        public void RunScriptError()
        {
            MainWindow.Ribbon.SelectGroup("Toolbox");

            MainWindow.Ribbon.ClickButton("RunScript");
            var fileDlg = new FileDialogAdaptor(MainWindow);

            Assert.That(fileDlg.Title, Is.EqualTo("Open Script..."));
            fileDlg.Load(Path.Combine(TestContext.CurrentContext.TestDirectory, @"..\..\Data\UnitTests\SourceData\Scripts\CompilerError.csx"));

            Assert.IsTrue(TaskDialogAdaptor.IsTaskDialogOpen(MainWindow));
            var errordlg = new TaskDialogAdaptor(MainWindow);

            Assert.AreEqual("Run script failed", errordlg.Title);
            errordlg.Close();
        }