Пример #1
0
        public void AddDuplicatePortNameThrowsError()
        {
            var node = new TestNodeA();

            node.AddPort(new Port {
                name = "Test"
            });

            Assert.Throws <ArgumentException>(
                () => node.AddPort(new Port {
                name = "Test"
            })
                );
        }
        public void AddPortThrowsOnDuplicateName()
        {
            var node = new TestNodeA();

            node.AddPort(new OutputPort <float> {
                Name = "Test"
            });

            Assert.Throws <ArgumentException>(
                () => node.AddPort(new OutputPort <float> {
                Name = "Test"
            })
                );
        }
Пример #3
0
        public void CanAddPorts()
        {
            var node  = new TestNodeA();
            var port1 = new Port {
                name = "Test 1"
            };
            var port2 = new Port {
                name = "Test 2"
            };

            node.AddPort(port1);
            node.AddPort(port2);

            Assert.AreEqual(2, node.ports.Count);
        }
Пример #4
0
        public void CanGetPorts()
        {
            var node = new TestNodeA();

            node.AddPort(new Port {
                name = "Test 1"
            });
            node.AddPort(new Port {
                name = "Test 2"
            });

            var actual = node.GetPort("Test 2");

            Assert.AreSame(node, actual.node);
            Assert.AreSame("Test 2", actual.name);
        }
        public void CanGetPorts()
        {
            var node = new TestNodeA();

            node.AddPort(new OutputPort <float> {
                Name = "Test 1"
            });
            node.AddPort(new OutputPort <float> {
                Name = "Test 2"
            });

            var actual = node.GetPort("Test 2");

            Assert.AreSame(node, actual.Node);
            Assert.AreSame("Test 2", actual.Name);
        }
        public void CanAddPorts()
        {
            var node  = new TestNodeA();
            var port1 = new OutputPort <float> {
                Name = "Test 1"
            };
            var port2 = new OutputPort <float> {
                Name = "Test 2"
            };

            node.AddPort(port1);
            node.AddPort(port2);

            // Test Node A comes with 2 ports by default
            Assert.AreEqual(4, node.Ports.Count);
            Assert.AreSame(port1, node.GetPort("Test 1"));
            Assert.AreSame(port2, node.GetPort("Test 2"));
        }