Beispiel #1
0
        public void TestCreateNodeOnEdge_WithOutputNodeConnectedToUnknown([Values] TestingMode mode)
        {
            var constantNode = GraphModel.CreateConstantNode("int1", typeof(int).GenerateTypeHandle(Stencil), Vector2.zero);
            var addNode      = GraphModel.CreateBinaryOperatorNode(BinaryOperatorKind.Add, Vector2.zero);

            GraphModel.CreateEdge(addNode.InputPortA, constantNode.OutputPort);
            GraphModel.CreateEdge(addNode.InputPortB, constantNode.OutputPort);

            var db   = new GraphElementSearcherDatabase(Stencil).AddBinaryOperators().Build();
            var item = (GraphNodeModelSearcherItem)db.Search("multiply", out _)[0];

            TestPrereqActionPostreq(mode,
                                    () =>
            {
                RefreshReference(ref addNode);
                RefreshReference(ref constantNode);
                Assert.That(GetNodeCount(), Is.EqualTo(2));
                Assert.That(GetEdgeCount(), Is.EqualTo(2));

                Assert.That(addNode, Is.Not.Null);
                Assert.That(addNode.InputPortA, Is.ConnectedTo(constantNode.OutputPort));
                var edge = GraphModel.EdgeModels.First();
                return(new CreateNodeOnEdgeAction(edge, Vector2.zero, item));
            },
                                    () =>
            {
                RefreshReference(ref addNode);
                RefreshReference(ref constantNode);
                var multiplyNode = GraphModel.NodeModels.OfType <BinaryOperatorNodeModel>().ToList()[1];

                Assert.IsNotNull(multiplyNode);
                Assert.That(GetNodeCount(), Is.EqualTo(3));
                Assert.That(GetEdgeCount(), Is.EqualTo(3));
                Assert.That(constantNode.OutputPort, Is.ConnectedTo(multiplyNode.InputPortA));
                Assert.That(multiplyNode.OutputPort, Is.ConnectedTo(addNode.InputPortA));
                Assert.That(constantNode.OutputPort, Is.Not.ConnectedTo(addNode.InputPortA));
            }
                                    );
        }
Beispiel #2
0
        public void TestCreateNodeOnEdge_BothPortsConnected([Values] TestingMode mode)
        {
            var constant = GraphModel.CreateConstantNode(typeof(int).GenerateTypeHandle(), "int", Vector2.zero);
            var unary    = GraphModel.CreateNode <Type0FakeNodeModel>("Node0", Vector2.zero);
            var edge     = GraphModel.CreateEdge(unary.Input0, constant.OutputPort);

            var gedb = new GraphElementSearcherDatabase(Stencil, GraphModel);

            Type0FakeNodeModel.AddToSearcherDatabase(GraphModel, gedb);
            var db   = gedb.Build();
            var item = (GraphNodeModelSearcherItem)db.Search(nameof(Type0FakeNodeModel))[0];

            TestPrereqCommandPostreq(mode,
                                     () =>
            {
                RefreshReference(ref unary);
                RefreshReference(ref constant);
                edge = GetEdge(0);
                Assert.That(GetNodeCount(), Is.EqualTo(2));
                Assert.That(GetEdgeCount(), Is.EqualTo(1));
                Assert.That(unary.Input0, Is.ConnectedTo(constant.OutputPort));
                return(new CreateNodeOnEdgeCommand(edge, Vector2.zero, item));
            },
                                     () =>
            {
                RefreshReference(ref unary);
                RefreshReference(ref constant);
                RefreshReference(ref edge);
                var unary2 = GraphModel.NodeModels.OfType <Type0FakeNodeModel>().ToList()[1];

                Assert.IsNotNull(unary2);
                Assert.That(GetNodeCount(), Is.EqualTo(3));
                Assert.That(GetEdgeCount(), Is.EqualTo(2));
                Assert.That(constant.OutputPort, Is.ConnectedTo(unary2.Input0));
                Assert.That(unary2.Output0, Is.ConnectedTo(unary.Input0));
                Assert.IsFalse(GraphModel.EdgeModels.Contains(edge));
            }
                                     );
        }
Beispiel #3
0
        public void Test_RemoveNodesAction([Values] TestingMode mode)
        {
            var        constantA  = GraphModel.CreateConstantNode("constantA", typeof(int).GenerateTypeHandle(Stencil), Vector2.zero);
            var        binary0    = GraphModel.CreateNode <Type0FakeNodeModel>("Node1", Vector2.zero);
            var        binary1    = GraphModel.CreateBinaryOperatorNode(BinaryOperatorKind.Add, Vector2.zero);
            IPortModel outputPort = constantA.OutputPort;

            GraphModel.CreateEdge(binary0.Input0, outputPort);
            IPortModel outputPort1 = binary0.Output0;

            GraphModel.CreateEdge(binary1.InputPortA, outputPort1);

            TestPrereqActionPostreq(mode,
                                    () =>
            {
                Refresh();
                var nodeToDeleteAndBypass = GraphModel.NodeModels.OfType <Type0FakeNodeModel>().First();

                Assert.That(GetNodeCount(), Is.EqualTo(3));
                Assert.That(GetEdgeCount(), Is.EqualTo(2));
                Assert.That(nodeToDeleteAndBypass.Input0, Is.ConnectedTo(constantA.OutputPort));
                Assert.That(binary1.InputPortA, Is.ConnectedTo(nodeToDeleteAndBypass.Output0));
                return(new RemoveNodesAction(new INodeModel[] { nodeToDeleteAndBypass }, new INodeModel[] { nodeToDeleteAndBypass }));
            },
                                    () =>
            {
                Refresh();
                Assert.That(GetNodeCount(), Is.EqualTo(2));
                Assert.That(GetEdgeCount(), Is.EqualTo(1));
                Assert.That(binary1.InputPortA, Is.ConnectedTo(constantA.OutputPort));
            });

            void Refresh()
            {
                RefreshReference(ref binary0);
                RefreshReference(ref binary1);
                RefreshReference(ref constantA);
            }
        }
Beispiel #4
0
        public void Test_RemoveFromGroupNodeAction([Values] TestingMode mode)
        {
            var g0    = GraphModel.CreateGroupNode("Group", Vector2.zero);
            var node0 = GraphModel.CreateConstantNode("const0", typeof(int).GenerateTypeHandle(Stencil), Vector2.zero);
            var node1 = GraphModel.CreateConstantNode("const1", typeof(int).GenerateTypeHandle(Stencil), Vector2.zero);

            g0.AddNodes(new [] { node0, node1 });
            TestPrereqActionPostreq(mode,
                                    () =>
            {
                Assert.That(GetNodeCount(), Is.EqualTo(3));
                Assert.That(GetNode(0), Is.TypeOf <GroupNodeModel>());
                var group = (GroupNodeModel)GetNode(0);
                Assert.That(group.NodeModels.Count(), Is.EqualTo(2));
                return(new RemoveFromGroupNodeAction(group, node0));
            },
                                    () =>
            {
                var group = (GroupNodeModel)GetNode(0);
                Assert.That(group.NodeModels.Count(), Is.EqualTo(1));
            });
        }
Beispiel #5
0
        public void Test_SplitEdgeAndInsertNodeAction([Values] TestingMode mode)
        {
            var constant = GraphModel.CreateConstantNode("Constant", typeof(int).GenerateTypeHandle(Stencil), Vector2.zero);
            var binary0  = GraphModel.CreateBinaryOperatorNode(BinaryOperatorKind.Add, Vector2.zero);
            var binary1  = GraphModel.CreateBinaryOperatorNode(BinaryOperatorKind.Add, Vector2.zero);
            var edge     = GraphModel.CreateEdge(binary0.InputPortA, constant.OutputPort);

            TestPrereqActionPostreq(mode,
                                    () =>
            {
                Assert.That(GetNodeCount(), Is.EqualTo(3));
                Assert.That(GetEdgeCount(), Is.EqualTo(1));
                Assert.That(binary0.InputPortA, Is.ConnectedTo(constant.OutputPort));
                return(new SplitEdgeAndInsertNodeAction(edge, binary1));
            },
                                    () =>
            {
                Assert.That(GetNodeCount(), Is.EqualTo(3));
                Assert.That(GetEdgeCount(), Is.EqualTo(2));
                Assert.That(binary1.InputPortA, Is.ConnectedTo(constant.OutputPort));
                Assert.That(binary0.InputPortA, Is.ConnectedTo(binary1.OutputPort));
            });
        }
        public IEnumerator LostEdgesAreDrawn()
        {
            var operatorModel           = GraphModel.CreateNode <Type0FakeNodeModel>("Node0", new Vector2(-100, -100));
            IConstantNodeModel intModel = GraphModel.CreateConstantNode(typeof(int).GenerateTypeHandle(), "int", new Vector2(-150, -100));
            var edge = (EdgeModel)GraphModel.CreateEdge(operatorModel.Input0, intModel.OutputPort);

            // simulate a renamed port by changing the edge's port id

            var field = typeof(EdgeModel).GetField("m_ToPortReference", BindingFlags.Instance | BindingFlags.NonPublic);
            var inputPortReference = (PortReference)field.GetValue(edge);

            inputPortReference.UniqueId = "asd";
            field.SetValue(edge, inputPortReference);

            edge.ResetPorts(); // get rid of cached port models

            MarkGraphViewStateDirty();
            yield return(null);

            var lostPortsAdded = GraphView.Query(className: "ge-port--data-type-missing-port").Build().ToList().Count;

            Assert.AreEqual(1, lostPortsAdded);
        }
Beispiel #7
0
        public void TestCreateNodeOnEdge_BothPortsConnected([Values] TestingMode mode)
        {
            var constant = GraphModel.CreateConstantNode("int", typeof(int).GenerateTypeHandle(Stencil), Vector2.zero);
            var unary    = GraphModel.CreateUnaryOperatorNode(UnaryOperatorKind.Minus, Vector2.zero);
            var edge     = GraphModel.CreateEdge(unary.InputPort, constant.OutputPort);

            var db   = new GraphElementSearcherDatabase(Stencil).AddUnaryOperators().Build();
            var item = (GraphNodeModelSearcherItem)db.Search("minus", out _)[0];

            TestPrereqActionPostreq(mode,
                                    () =>
            {
                RefreshReference(ref unary);
                RefreshReference(ref constant);
                edge = GetEdge(0);
                Assert.That(GetNodeCount(), Is.EqualTo(2));
                Assert.That(GetEdgeCount(), Is.EqualTo(1));
                Assert.That(unary.InputPort, Is.ConnectedTo(constant.OutputPort));
                return(new CreateNodeOnEdgeAction(edge, Vector2.zero, item));
            },
                                    () =>
            {
                RefreshReference(ref unary);
                RefreshReference(ref constant);
                RefreshReference(ref edge);
                var unary2 = GraphModel.NodeModels.OfType <UnaryOperatorNodeModel>().ToList()[1];

                Assert.IsNotNull(unary2);
                Assert.That(GetNodeCount(), Is.EqualTo(3));
                Assert.That(GetEdgeCount(), Is.EqualTo(2));
                Assert.That(constant.OutputPort, Is.ConnectedTo(unary2.InputPort));
                Assert.That(unary2.OutputPort, Is.ConnectedTo(unary.InputPort));
                Assert.IsFalse(GraphModel.EdgeModels.Contains(edge));
            }
                                    );
        }
Beispiel #8
0
        public void Test_EmbeddedConstantIsUsedWhenDisconnected([Values] TestingMode mode)
        {
            const float outerValue = 42f;
            const float innerValue = 347f;

            // make sure that we really test values that are not default
            Assume.That(outerValue, Is.Not.EqualTo(default(float)));
            Assume.That(innerValue, Is.Not.EqualTo(default(float)));

            var stencil = GraphModel.Stencil;

            FunctionModel a = GraphModel.CreateFunction("A", Vector2.zero);

            // Debug.Log(...)
            MethodInfo logMethod = typeof(Debug).GetMethod(nameof(Debug.Log), new[] { typeof(object) });

            Assume.That(logMethod, Is.Not.Null);
            FunctionCallNodeModel log = a.CreateStackedNode <FunctionCallNodeModel>("Log", 0, SpawnFlags.Default, n => n.MethodInfo = logMethod);
            var logParameterPort      = log.GetParameterPorts().Single();

            // Math.Abs(...)
            MethodInfo absMethod = typeof(Mathf).GetMethod(nameof(Mathf.Abs), new[] { typeof(float) });

            Assume.That(absMethod, Is.Not.Null);
            FunctionCallNodeModel abs = GraphModel.CreateNode <FunctionCallNodeModel>("Abs", Vector2.zero, SpawnFlags.Default, n => n.MethodInfo = absMethod);
            var absParameterPort      = abs.GetParameterPorts().Single();

            ((FloatConstantModel)abs.InputConstantsById[absParameterPort.UniqueId]).value = innerValue;

            GraphModel.CreateEdge(logParameterPort, abs.OutputPort);

            // float
            IConstantNodeModel outerFloat = GraphModel.CreateConstantNode("float42", typeof(float).GenerateTypeHandle(stencil), Vector2.zero);

            Assume.That(outerFloat, Is.Not.Null);
            ((FloatConstantModel)outerFloat).value = outerValue;

            string innerFloatString = SyntaxFactory.LiteralExpression(
                SyntaxKind.NumericLiteralExpression,
                SyntaxFactory.Literal(innerValue)).ToFullString();
            string outerFloatString = SyntaxFactory.LiteralExpression(
                SyntaxKind.NumericLiteralExpression,
                SyntaxFactory.Literal(outerValue)).ToFullString();

            TestPrereqActionPostreq(mode,
                                    () =>
            {
                // outer float disconnected, check that we use the inner value
                SyntaxNode astRoot = CompileCurrentGraphModel();
                LiteralExpressionSyntax literalInsideLogAbs = GetLiteralInsideLogAbs(astRoot);
                Assert.That(literalInsideLogAbs.ToFullString(), Is.EqualTo(innerFloatString));
                return(new CreateEdgeAction(absParameterPort, outerFloat.OutputPort));
            },
                                    () =>
            {
                // outer float connected, check that we use the outer value
                SyntaxNode astRoot = CompileCurrentGraphModel();
                LiteralExpressionSyntax literalInsideLogAbs = GetLiteralInsideLogAbs(astRoot);
                Assert.That(literalInsideLogAbs.ToFullString(), Is.EqualTo(outerFloatString));
            });
        }
Beispiel #9
0
        public void Test_BypassNodeAction_Throw()
        {
            var constantA = GraphModel.CreateConstantNode("constantA", typeof(float).GenerateTypeHandle(Stencil), Vector2.zero);

            Assert.Throws <InvalidOperationException>(() => m_Store.Dispatch(new BypassNodeAction(constantA)));
        }
Beispiel #10
0
        public void Test_BypassNodeAction([Values] TestingMode mode)
        {
            var constantA = GraphModel.CreateConstantNode("constantA", typeof(float).GenerateTypeHandle(Stencil), Vector2.zero);
            var binary0   = GraphModel.CreateBinaryOperatorNode(BinaryOperatorKind.Add, Vector2.zero);
            var binary1   = GraphModel.CreateBinaryOperatorNode(BinaryOperatorKind.Add, Vector2.zero);

            GraphModel.CreateEdge(binary0.InputPortA, constantA.OutputPort);
            GraphModel.CreateEdge(binary1.InputPortA, binary0.OutputPort);

            var constantB = GraphModel.CreateConstantNode("constantB", typeof(float).GenerateTypeHandle(Stencil), Vector2.zero);
            var binary2   = GraphModel.CreateBinaryOperatorNode(BinaryOperatorKind.Add, Vector2.zero);
            var binary3   = GraphModel.CreateBinaryOperatorNode(BinaryOperatorKind.Add, Vector2.zero);

            GraphModel.CreateEdge(binary2.InputPortA, constantB.OutputPort);
            GraphModel.CreateEdge(binary3.InputPortA, binary2.OutputPort);

            var constantC = GraphModel.CreateConstantNode("constantC", typeof(float).GenerateTypeHandle(Stencil), Vector2.zero);
            var binary4   = GraphModel.CreateBinaryOperatorNode(BinaryOperatorKind.Add, Vector2.zero);
            var binary5   = GraphModel.CreateBinaryOperatorNode(BinaryOperatorKind.Add, Vector2.zero);

            GraphModel.CreateEdge(binary4.InputPortA, constantC.OutputPort);
            GraphModel.CreateEdge(binary5.InputPortA, binary4.OutputPort);

            TestPrereqActionPostreq(mode,
                                    () =>
            {
                Assert.That(GetNodeCount(), Is.EqualTo(9));
                Assert.That(GetEdgeCount(), Is.EqualTo(6));
                Assert.That(binary0.InputPortA, Is.ConnectedTo(constantA.OutputPort));
                Assert.That(binary1.InputPortA, Is.ConnectedTo(binary0.OutputPort));
                Assert.That(binary2.InputPortA, Is.ConnectedTo(constantB.OutputPort));
                Assert.That(binary3.InputPortA, Is.ConnectedTo(binary2.OutputPort));
                Assert.That(binary4.InputPortA, Is.ConnectedTo(constantC.OutputPort));
                Assert.That(binary5.InputPortA, Is.ConnectedTo(binary4.OutputPort));
                return(new BypassNodeAction(binary0));
            },
                                    () =>
            {
                Assert.That(GetNodeCount(), Is.EqualTo(9));
                Assert.That(GetEdgeCount(), Is.EqualTo(5));
                Assert.That(binary1.InputPortA, Is.ConnectedTo(constantA.OutputPort));
                Assert.That(binary2.InputPortA, Is.ConnectedTo(constantB.OutputPort));
                Assert.That(binary3.InputPortA, Is.ConnectedTo(binary2.OutputPort));
                Assert.That(binary4.InputPortA, Is.ConnectedTo(constantC.OutputPort));
                Assert.That(binary5.InputPortA, Is.ConnectedTo(binary4.OutputPort));
            });

            TestPrereqActionPostreq(mode,
                                    () =>
            {
                Assert.That(GetNodeCount(), Is.EqualTo(9));
                Assert.That(GetEdgeCount(), Is.EqualTo(5));
                Assert.That(binary1.InputPortA, Is.ConnectedTo(constantA.OutputPort));
                Assert.That(binary2.InputPortA, Is.ConnectedTo(constantB.OutputPort));
                Assert.That(binary3.InputPortA, Is.ConnectedTo(binary2.OutputPort));
                Assert.That(binary4.InputPortA, Is.ConnectedTo(constantC.OutputPort));
                Assert.That(binary5.InputPortA, Is.ConnectedTo(binary4.OutputPort));
                return(new BypassNodeAction(binary2, binary4));
            },
                                    () =>
            {
                Assert.That(GetNodeCount(), Is.EqualTo(9));
                Assert.That(GetEdgeCount(), Is.EqualTo(3));
                Assert.That(binary1.InputPortA, Is.ConnectedTo(constantA.OutputPort));
                Assert.That(binary3.InputPortA, Is.ConnectedTo(constantB.OutputPort));
                Assert.That(binary5.InputPortA, Is.ConnectedTo(constantC.OutputPort));
            });
        }
Beispiel #11
0
        public void Test_EditPropertyGroupNodeAction_AddRemove([Values] TestingMode mode)
        {
            IConstantNodeModel        constant = GraphModel.CreateConstantNode("toto", typeof(Vector3).GenerateTypeHandle(Stencil), Vector2.zero);
            GetPropertyGroupNodeModel property = GraphModel.CreateGetPropertyGroupNode(Vector2.zero);

            GraphModel.CreateEdge(property.InstancePort, constant.OutputPort);

            Type       type       = typeof(GameObject);
            MemberInfo memberInfo = type.GetMembers()[0];
            var        newMember  = new TypeMember
            {
                Path = new List <string> {
                    memberInfo.Name
                },
                Type = memberInfo.GetUnderlyingType().GenerateTypeHandle(Stencil)
            };


            TestPrereqActionPostreq(mode,
                                    () =>
            {
                property = (GetPropertyGroupNodeModel)GraphModel.NodesByGuid[property.Guid];

                Assert.That(GetNodeCount(), Is.EqualTo(2));
                Assert.That(GetEdgeCount(), Is.EqualTo(1));
                Assert.That(property.GetPortsForMembers().Count(), Is.EqualTo(0));
                Assert.That(property.OutputsByDisplayOrder.Count(), Is.EqualTo(0));
                return(new EditPropertyGroupNodeAction(
                           EditPropertyGroupNodeAction.EditType.Add,
                           property,
                           newMember));
            },
                                    () =>
            {
                property = (GetPropertyGroupNodeModel)GraphModel.NodesByGuid[property.Guid];

                Assert.That(GetNodeCount(), Is.EqualTo(2));
                Assert.That(GetEdgeCount(), Is.EqualTo(1));
                Assert.That(property.GetPortsForMembers().Count(), Is.EqualTo(1));
                Assert.That(property.OutputsByDisplayOrder.Count(), Is.EqualTo(1));
            });

            TestPrereqActionPostreq(mode,
                                    () =>
            {
                property = (GetPropertyGroupNodeModel)GraphModel.NodesByGuid[property.Guid];

                Assert.That(GetNodeCount(), Is.EqualTo(2));
                Assert.That(GetEdgeCount(), Is.EqualTo(1));
                Assert.That(property.GetPortsForMembers().Count(), Is.EqualTo(1));
                Assert.That(property.OutputsByDisplayOrder.Count(), Is.EqualTo(1));
                return(new EditPropertyGroupNodeAction(
                           EditPropertyGroupNodeAction.EditType.Remove,
                           property,
                           newMember));
            },
                                    () =>
            {
                property = (GetPropertyGroupNodeModel)GraphModel.NodesByGuid[property.Guid];

                Assert.That(GetNodeCount(), Is.EqualTo(2));
                Assert.That(GetEdgeCount(), Is.EqualTo(1));
                Assert.That(property.GetPortsForMembers().Count(), Is.EqualTo(0));
                Assert.That(property.OutputsByDisplayOrder.Count(), Is.EqualTo(0));
            });
        }
Beispiel #12
0
        public IEnumerator AlignNodesHierarchiesCommandWorks([Values] TestingMode mode)
        {
            var constantA = GraphModel.CreateConstantNode(typeof(int).GenerateTypeHandle(), "constantA", Vector2.zero);
            var binary0   = GraphModel.CreateNode <Type0FakeNodeModel>("Node1", Vector2.one * 200);
            var binary1   = GraphModel.CreateNode <Type0FakeNodeModel>("Node2", Vector2.one * 500);

            GraphModel.CreateEdge(binary0.Input0, constantA.OutputPort);
            GraphModel.CreateEdge(binary1.Input0, binary0.Output0);

            MarkGraphViewStateDirty();
            yield return(null);

            void RefreshModelReferences()
            {
                constantA = GraphModel.NodeModels[0] as IConstantNodeModel;
                binary0   = GraphModel.NodeModels[1] as Type0FakeNodeModel;
                binary1   = GraphModel.NodeModels[2] as Type0FakeNodeModel;

                Assert.IsNotNull(constantA);
                Assert.IsNotNull(binary0);
                Assert.IsNotNull(binary1);
            }

            yield return(TestPrereqCommandPostreq(mode,
                                                  () =>
            {
                RefreshModelReferences();

                Assert.That(binary0.Input0, Is.ConnectedTo(constantA.OutputPort));
                Assert.That(binary1.Input0, Is.ConnectedTo(binary0.Output0));

                var port0UI = binary0.Output0.GetUI <Port>(GraphView);
                Assert.IsNotNull(port0UI);
                var port1UI = binary1.Input0.GetUI <Port>(GraphView);
                Assert.IsNotNull(port1UI);
                Assert.AreNotEqual(GetPortY(port0UI), GetPortY(port1UI));

                var port2UI = constantA.OutputPort.GetUI <Port>(GraphView);
                Assert.IsNotNull(port2UI);
                var port3UI = binary0.Input0.GetUI <Port>(GraphView);
                Assert.IsNotNull(port3UI);
                Assert.AreNotEqual(GetPortY(port2UI), GetPortY(port3UI));
            },
                                                  frame =>
            {
                switch (frame)
                {
                case 0:
                    CommandDispatcher.Dispatch(new AlignNodesCommand(GraphView, true, binary1));
                    return TestPhase.WaitForNextFrame;

                default:
                    return TestPhase.Done;
                }
            },
                                                  () =>
            {
                RefreshModelReferences();

                var port0UI = binary0.Output0.GetUI <Port>(GraphView);
                Assert.IsNotNull(port0UI);
                var port1UI = binary1.Input0.GetUI <Port>(GraphView);
                Assert.IsNotNull(port1UI);
                Assert.AreEqual(GetPortY(port0UI), GetPortY(port1UI));

                var port2UI = constantA.OutputPort.GetUI <Port>(GraphView);
                Assert.IsNotNull(port2UI);
                var port3UI = binary0.Input0.GetUI <Port>(GraphView);
                Assert.IsNotNull(port3UI);
                Assert.AreEqual(GetPortY(port2UI), GetPortY(port3UI));
            }));
        }