Exemplo n.º 1
0
        public void TestLoadFilteredTree()
        {
            guiFuctions.loadGrantProject(treePathUia2);
            if (grantTrees.filteredTree == null)
            {
                Assert.Fail("Es ist kein gefilterter Baum vorhanden!");
            }
            if (strategyMgr.getSpecifiedTree().Count(grantTrees.filteredTree) != 45)
            {
                Assert.Fail("Der gefilterte Baum hätte 45 Knoten haben müssen -- er hat {0} Knoten!", strategyMgr.getSpecifiedTree().Count(grantTrees.filteredTree));
            }
            String mainFilterstrategy = treeOperation.searchNodes.getMainFilterstrategyOfTree();

            if (!mainFilterstrategy.Equals("StrategyUIA.FilterStrategyUIA, StrategyUIA"))
            {
                Assert.Fail("Der 1. Knoten hätte mit 'StrategyUIA.FilterStrategyUIA' gefiltert werden sollen -- genutzter Filter ist '{0}'", mainFilterstrategy);
            }
            String nodeFS_ED842B72B012E86CE468B73FA1378361 = treeOperation.searchNodes.getFilteredTreeOsmElementById("ED842B72B012E86CE468B73FA1378361").properties.grantFilterStrategy;

            if (!Settings.strategyUserNameToClassName(nodeFS_ED842B72B012E86CE468B73FA1378361).Equals("StrategyUIA2.FilterStrategyUIA2, StrategyUIA2"))
            {
                Assert.Fail("Der Knoten mit der Id 'ED842B72B012E86CE468B73FA1378361' hätte mit 'StrategyUIA2.FilterStrategyUIA2' gefiltert werden sollen -- genutzter Filter ist '{0}'", nodeFS_ED842B72B012E86CE468B73FA1378361);
            }
            guiFuctions.deleteGrantTrees();
        }
Exemplo n.º 2
0
        public void TestGetPinsAsStringInFilteredTree()
        {
            guiFuctions.loadGrantProject(treePath);
            Assert.AreNotEqual(grantTrees, null);
            Assert.AreNotEqual(grantTrees.filteredTree, null);
            Assert.AreNotEqual(grantTrees.brailleTree, null);

            System.Windows.Forms.SendKeys.SendWait("{ESC}"); // set focus back to Visual Studio
            System.Threading.Thread.Sleep(2000);             // Wait of connection to MVBD & first conntent sets
            if (!strategyMgr.getSpecifiedOperationSystem().isApplicationRunning("MVBD"))
            {
                Assert.Fail("MVBD isn't running!");
            }
            if (!strategyMgr.getSpecifiedOperationSystem().isApplicationRunning("NVDA"))
            {
                Assert.Fail("NVDA isn't running!");
            }
            System.Threading.Thread.Sleep(2000);
            OSMElement content = strategyMgr.getSpecifiedExternalScreenreader().getScreenreaderContent();

            Assert.AreNotEqual(null, content);
            Debug.WriteLine(content);
            int treeNodeOld = strategyMgr.getSpecifiedTree().Count(grantTrees.filteredTree);

            // add node to filtered tree
            treeOperation.updateNodes.addNodeExternalScreenreaderInFilteredTree(content);
            Assert.AreEqual(treeNodeOld + 1, strategyMgr.getSpecifiedTree().Count(grantTrees.filteredTree));
            Debug.WriteLine("Tree with external screenreader node:\n" + strategyMgr.getSpecifiedTree().ToStringRecursive(grantTrees.filteredTree));
        }
Exemplo n.º 3
0
        private void Button_Click_Laden(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            // dlg.FileName = "filteredProject_" + grantTree.filteredTree.Child.Data.properties.nameFiltered; // Default file name
            dlg.DefaultExt       = ".grant";                           // Default file extension
            dlg.Filter           = "GRANT documents (.grant)|*.grant"; // Filter files by extension
            dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            // Show open file dialog box
            Nullable <bool> result = dlg.ShowDialog();

            // Process open file dialog box results
            if (result == true)
            {
                guiFunctions.loadGrantProject(dlg.FileName);
            }
        }
Exemplo n.º 4
0
        public void UpdateNodeTest_grantFilterstrategyChildren()
        {
            String idPaneNode = "417F2ACC323396E993B4DC2AD2515D5E";

            guiFuctions.loadGrantProject(treePathUia2);
            OSMElements.OSMElement paneNodeOld = treeOperation.searchNodes.getFilteredTreeOsmElementById(idPaneNode).DeepCopy();

            UpdateNodes up = new UpdateNodes(strategyMgr, grantTrees, treeOperation);

            up.filteredNodeElementOfApplication(idPaneNode);
            OSMElements.OSMElement paneNodeNew = treeOperation.searchNodes.getFilteredTreeOsmElementById(idPaneNode);
            Assert.AreEqual(paneNodeOld.properties.grantFilterStrategy, paneNodeNew.properties.grantFilterStrategy);
            //Assert.AreEqual(paneNodeOld.properties.grantFilterStrategiesChildren, paneNodeNew.properties.grantFilterStrategiesChildren);
            if (!paneNodeOld.properties.grantFilterStrategiesChildren.All(p => paneNodeNew.properties.grantFilterStrategiesChildren.Contains(p))) // check whether 'osmParent.properties.grantFilterStrategiesChildren' is a subset of filterStrategiesChildren
            {
                Assert.Fail("The update of the 'grantFilterStrategiesChildren' wasn't correct!");
            }
        }
Exemplo n.º 5
0
        private void LoadButton_Click(object sender, RoutedEventArgs e)
        {
            String fileName = guiFunctions.openFileDialog(".grant", "GRANT documents (.grant)|*.grant", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));

            if (fileName == null)
            {
                System.Windows.Forms.MessageBox.Show("The chosen screen reader doesn't exist!", "GRANT exception"); return;
            }

            guiFunctions.loadGrantProject(fileName);
            Object tree = grantTrees.filteredTree;

            filteredTreeOutput.Items.Clear();
            root.Items.Clear();
            root.Header = "Filtered - Tree - Updated";
            guiFunctions.createTreeForOutput(tree, ref root); filteredTreeOutput.Items.Add(root);
            NodeButton.IsEnabled = false;
            updatePropertiesTable(strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Child(tree)).properties.IdGenerated);
            SaveButton.IsEnabled = true;
        }