public void ImportSolidCancelFileDlg()
        {
            string path = Path.GetFullPath(Path.Combine(TestContext.CurrentContext.TestDirectory, @"..\..\Data\UITests\SourceData\ImportMesh.obj"));

            MainWindow.Ribbon.ClickFileMenuItem("ImportFileToModel");

            var fileDlg = new FileDialogAdaptor(MainWindow);

            fileDlg.Cancel();
            Assert.IsFalse(FileDialogAdaptor.IsDialogOpen(MainWindow));
            Assert.IsFalse(WindowAdaptor.IsWindowOpen(MainWindow, "ExchangerSettings"));
            Assert.That(Pipe.GetValue <int>("$Context.Document.ChildCount") == 0);
        }
        public void ExportSolidCancelFileDlg()
        {
            var path = Path.Combine(FileDialogAdaptor.GetTempPath(), "testexport.brep");

            System.IO.File.Delete(path);
            TestDataGenerator.GenerateBox(MainWindow);

            MainWindow.Ribbon.ClickFileMenuItem("ExportSelectedBrep");

            var fileDlg = new FileDialogAdaptor(MainWindow);

            fileDlg.Cancel();
            Assert.IsFalse(FileDialogAdaptor.IsDialogOpen(MainWindow));
            Assert.IsFalse(WindowAdaptor.IsWindowOpen(MainWindow, "ExchangerSettings"));

            Assert.IsFalse(System.IO.File.Exists(path));
        }
        public void ImportSketchCancelFileDlg()
        {
            TestDataGenerator.GenerateSketch(MainWindow);

            MainWindow.Ribbon.SelectGroup("Sketch");
            MainWindow.Ribbon.ClickButton("SketchExchange");
            var menu = new ContextMenuAdaptor(MainWindow);

            menu.ClickMenuItem("ImportFromFile");

            var fileDlg = new FileDialogAdaptor(MainWindow);

            fileDlg.Cancel();
            Assert.IsFalse(FileDialogAdaptor.IsDialogOpen(MainWindow));
            Assert.IsFalse(WindowAdaptor.IsWindowOpen(MainWindow, "ExchangerSettings"));

            Assert.AreEqual(4, Pipe.GetValue <int>("$Sketch.Segments.Count"));
        }
        public void ExportSketchCancelFileDlg()
        {
            var path = Path.Combine(FileDialogAdaptor.GetTempPath(), "sketch.svg");

            System.IO.File.Delete(path);
            TestDataGenerator.GenerateSketch(MainWindow);

            // Do Export
            MainWindow.Ribbon.SelectGroup("Sketch");
            MainWindow.Ribbon.ClickButton("SketchExchange");
            var menu = new ContextMenuAdaptor(MainWindow);

            menu.ClickMenuItem("ExportAllToFile");

            var fileDlg = new FileDialogAdaptor(MainWindow);

            fileDlg.Cancel();
            Assert.IsFalse(FileDialogAdaptor.IsDialogOpen(MainWindow));
            Assert.IsFalse(WindowAdaptor.IsWindowOpen(MainWindow, "ExchangerSettings"));

            Assert.IsFalse(System.IO.File.Exists(path));
        }