Exemplo n.º 1
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.º 2
0
        public void UpdateNodeTest()
        {
            HelpFunctions hf = new HelpFunctions(strategyMgr, grantTrees);

            hf.filterApplication(applicationName, applicationPathName);

            treeOperation.updateNodes.filterSubtreeWithCurrentFilterStrtegy(idTextNodeCalc);

            IntPtr appHwnd = strategyMgr.getSpecifiedOperationSystem().getHandleOfApplication(applicationName);

            strategyMgr.getSpecifiedOperationSystem().setForegroundWindow(appHwnd);
            //Send Key -> Inhalt im Textfeld soll sich ändern
            System.Windows.Forms.SendKeys.SendWait("{ESC}");
            System.Windows.Forms.SendKeys.SendWait("42");
            UpdateNodes up = new UpdateNodes(strategyMgr, grantTrees, treeOperation);

            up.filteredNodeElementOfApplication(idTextNodeCalc);
            OSMElements.OSMElement textNode = treeOperation.searchNodes.getFilteredTreeOsmElementById(idTextNodeCalc);
            if (!textNode.properties.nameFiltered.Equals("42"))
            {
                Assert.Fail("Der Knoten wurde nicht richtig geändert oder geupdatet!\nBetrachteter Knoten:\n{0}", textNode);
            }
        }