예제 #1
0
        public void TestCreateVarArgFunctionNode()
        {
            //Arrange
            string documentDynPath = Path.Combine(TestDirectory, @"core\dsevaluation\Defect_MAGN_2375_3487.dyn");
            XmlDocument xmlDoc = new XmlDocument();
            XmlDocument xmlOldNodeDoc = new XmlDocument();
            xmlOldNodeDoc.LoadXml("<Dynamo.Graph.Nodes.ZeroTouch.DSVarArgFunction type=\"Dynamo.Graph.Nodes.ZeroTouch.DSVarArgFunction\" x=\"203.6\" y=\"220\"/>");
            XmlElement xmlOldNode = xmlOldNodeDoc.DocumentElement;
            XmlElement xmlResult = null;

            //Act
            if (File.Exists(documentDynPath))
            {
                xmlDoc.Load(documentDynPath);
                xmlResult = MigrationManager.CreateVarArgFunctionNode(xmlDoc, xmlOldNode, 0, "DSCoreNodes.dll", "String.Split", "DSCore.String.Split@string,string[]", "2");
            }

            //Assert
            //Check that all the attibutes where generated correctly
            Assert.IsNotNull(xmlResult);
            Assert.AreEqual(xmlResult.GetAttribute("type"), "Dynamo.Graph.Nodes.ZeroTouch.DSVarArgFunction");
            Assert.AreEqual(xmlResult.GetAttribute("assembly"), "DSCoreNodes.dll");
            Assert.AreEqual(xmlResult.GetAttribute("nickname"), "String.Split");
            Assert.AreEqual(xmlResult.GetAttribute("function"), "DSCore.String.Split@string,string[]");
        }