public void TestNodeCanLoadInputPortsFromAttributes()
        {
            var node = new DummyNodeModel();
            Assert.AreEqual(2, node.InPorts.Count);

            Assert.AreEqual("input1", node.InPorts[0].PortName);
            Assert.AreEqual("input2", node.InPorts[1].PortName);

            Assert.AreEqual("This is input1", node.InPorts[0].ToolTip);
            Assert.AreEqual("This is input2", node.InPorts[1].ToolTip);

            var typeLoadData = new TypeLoadData(node.GetType());
            Assert.AreEqual(2, typeLoadData.InputParameters.Count());

            Assert.AreEqual(Tuple.Create("input1", "int"), typeLoadData.InputParameters.ElementAt(0));
            Assert.AreEqual(Tuple.Create("input2", "double"), typeLoadData.InputParameters.ElementAt(1));
        }
Exemplo n.º 2
0
        public void TestNodeCanLoadInputPortsFromAttributes()
        {
            var node = new DummyNodeModel();

            Assert.AreEqual(2, node.InPorts.Count);

            Assert.AreEqual("input1", node.InPorts[0].PortName);
            Assert.AreEqual("input2", node.InPorts[1].PortName);

            Assert.AreEqual("This is input1", node.InPorts[0].ToolTip);
            Assert.AreEqual("This is input2", node.InPorts[1].ToolTip);

            var typeLoadData = new TypeLoadData(node.GetType());

            Assert.AreEqual(2, typeLoadData.InputParameters.Count());

            Assert.AreEqual(Tuple.Create("input1", "int"), typeLoadData.InputParameters.ElementAt(0));
            Assert.AreEqual(Tuple.Create("input2", "double"), typeLoadData.InputParameters.ElementAt(1));
        }
Exemplo n.º 3
0
        public void TestNodeCanLoadOutputPortsFromAttributes()
        {
            var node = new DummyNodeModel();

            Assert.AreEqual(2, node.InPorts.Count);

            Assert.AreEqual("output1", node.OutPorts[0].PortName);
            Assert.AreEqual("output2", node.OutPorts[1].PortName);

            Assert.AreEqual("some description", node.OutPorts[0].ToolTip);
            Assert.AreEqual("", node.OutPorts[1].ToolTip);

            var typeLoadData = new TypeLoadData(node.GetType());

            Assert.AreEqual(2, typeLoadData.OutputParameters.Count());

            Assert.AreEqual("foo", typeLoadData.OutputParameters.ElementAt(0));
            Assert.AreEqual("bla", typeLoadData.OutputParameters.ElementAt(1));
        }
        public void TestNodeCanLoadOutputPortsFromAttributes()
        {
            var node = new DummyNodeModel();
            Assert.AreEqual(2, node.InPorts.Count);

            Assert.AreEqual("output1", node.OutPorts[0].PortName);
            Assert.AreEqual("output2", node.OutPorts[1].PortName);

            Assert.AreEqual("some description", node.OutPorts[0].ToolTip);
            Assert.AreEqual("", node.OutPorts[1].ToolTip);

            var typeLoadData = new TypeLoadData(node.GetType());
            Assert.AreEqual(2, typeLoadData.OutputParameters.Count());

            Assert.AreEqual("foo", typeLoadData.OutputParameters.ElementAt(0));
            Assert.AreEqual("bla", typeLoadData.OutputParameters.ElementAt(1));
        }