Пример #1
0
        public void Defect_IDE_1493()
        {
            // IDE-1493 Output slot location mismatched for CBN with multi-lines

            // Create code block node with the following content to verify both
            // the input and output line information:
            //
            //      |    1 + 4;                  |
            //      |                            |
            //      |    a+ b;                   |
            //      |                            |
            //      |    { 1, 2, 3, 4, 5, 6 };   |
            //      |                            |
            //      |    1..20..2;               |
            //
            string commands = @"
                CreateCodeBlockNode|d:15429.0|d:15131.0|s:Your code goes here
                BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
                EndNodeEdit|u:0x10000001|s:1+4;\n\na+b;\n\n{1,2,3,4,5,6};\n\n1..20..2;|b:True";

            GraphController controller = new GraphController(null);
            bool result = controller.RunCommands(commands);
            Assert.AreEqual(true, result);

            TestHelpers helper = new TestHelpers(controller);

            Dictionary<int, List<VariableLine>> inputLines = new Dictionary<int, List<VariableLine>>();
            inputLines.Add(1, new List<VariableLine>()); // Second statement.
            inputLines[1].Add(new VariableLine("a", 2)); // 'a' on the third line.
            inputLines[1].Add(new VariableLine("b", 2)); // 'b' on the third line.
            helper.EnsureInputLines(0x10000001, inputLines);

            List<VariableLine> outputLines = new List<VariableLine>();
            outputLines.Add(new VariableLine(0)); // Temporary on line 0.
            outputLines.Add(new VariableLine(2)); // Temporary on line 2.
            outputLines.Add(new VariableLine(4)); // Temporary on line 4.
            outputLines.Add(new VariableLine(6)); // Temporary on line 6.
            helper.EnsureOutputLines(0x10000001, outputLines);
        }
Пример #2
0
        public void Defect_IDE_1365()
        {
            // Error message is not coming once user redefined the variable after first error message.
            // Create Code Block with "a = 10".
            // Now create Code Block with "a = 20".
            // After above step error message will pop up for second Code Block.
            // Now edit the second Code Block with something line "a a = 20"
            // there is a space between both "a", so DSS will again pop up an error message.
            // Now again edit the Code Block to "a = 20".
            // After above step there is no output slot for "a = 20" and there is no error message for redefining the variable.

            string commands = @"
                CreateCodeBlockNode|d:15413.0|d:15107.0|s:Your code goes here
                BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
                EndNodeEdit|u:0x10000001|s:a=10|b:True
                CreateCodeBlockNode|d:15513.0|d:15148.0|s:Your code goes here
                BeginNodeEdit|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text
                EndNodeEdit|u:0x10000002|s:a=20;|b:True
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                BeginNodeEdit|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                EndNodeEdit|u:0x10000002|s:a a = 20;|b:True
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                BeginNodeEdit|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                EndNodeEdit|u:0x10000002|s:a = 20;|b:True";

            GraphController controller = new GraphController(null);
            bool result = controller.RunCommands(commands);
            Assert.AreEqual(true, result);
            Assert.AreEqual(2, controller.GetVisualNodes().Count);

            TestHelpers testHelper = new TestHelpers(controller);
            testHelper.EnsureNodeSlotInfo(0x10000001, null, new uint[] { 0x30000001 });
            testHelper.EnsureNodeSlotInfo(0x10000002, null, new uint[] { 0x30000003 });
            testHelper.EnsureSlotInfo(0x30000001, SlotType.Output, true, new uint[] { 0x10000001 }, null);
            testHelper.EnsureSlotInfo(0x30000003, SlotType.Output, true, new uint[] { 0x10000002 }, null);

            Assert.IsNullOrEmpty(controller.GetVisualNode(0x10000001).ErrorMessage);
            Assert.IsNotNullOrEmpty(controller.GetVisualNode(0x10000002).ErrorMessage);
        }