コード例 #1
0
        public void ConstructorWithPortsTest()
        {
            //Ports for testing
            PortModel inPort  = new PortModel(PortType.Input, testNode, new PortData("input", "input port"));
            PortModel outPort = new PortModel(PortType.Output, testNode, new PortData("output", "output port"));

            IEnumerable <PortModel> inPorts = new List <PortModel> {
                inPort
            };
            IEnumerable <PortModel> outPorts = new List <PortModel> {
                outPort
            };

            //Creates the new selection
            selection = new SelectionConcrete(
                SelectionType.Many,
                SelectionObjectType.Element,
                "testMessage",
                "testPrefix",
                new List <string> {
                "selection Identifier"
            },
                inPorts,
                outPorts);

            Assert.AreEqual(inPort.GUID, selection.InPorts.FirstOrDefault().GUID);
            Assert.AreEqual(outPort.GUID, selection.OutPorts.FirstOrDefault().GUID);
        }
コード例 #2
0
 public void TestsSetup()
 {
     selectionHelperMock = new Mock <IModelSelectionHelper <ModelBase> >(MockBehavior.Strict);
     selection           = new SelectionConcrete(SelectionType.Many, SelectionObjectType.Element, "testMessage", "testPrefix", selectionHelperMock.Object);
     selection.Name      = "selectionTestName";
     testNode            = CreateCodeBlockNode();
 }
コード例 #3
0
        public void GetSelectionOutputTest(SelectionObjectType selectionObjectType, SelectionType selectinType, string expectedResult)
        {
            selection = new SelectionConcrete(selectinType, selectionObjectType, "testMessage", "testPrefix");

            var result = selection.GetOutputPortName();

            Assert.AreEqual(expectedResult, result);
        }
コード例 #4
0
        public void GetSelectionOutputTest()
        {
            //Case ObjectType: Edge
            selection = new SelectionConcrete(SelectionType.One, SelectionObjectType.Edge, "testMessage", "testPrefix");
            var expectedResult = "Curve";
            var result         = selection.GetOutputPortName();

            Assert.AreEqual(expectedResult, result);

            selection      = new SelectionConcrete(SelectionType.Many, SelectionObjectType.Edge, "testMessage", "testPrefix");
            expectedResult = "Curves";
            result         = selection.GetOutputPortName();
            Assert.AreEqual(expectedResult, result);

            //Case ObjectType: Face
            selection      = new SelectionConcrete(SelectionType.One, SelectionObjectType.Face, "testMessage", "testPrefix");
            expectedResult = "Surface";
            result         = selection.GetOutputPortName();
            Assert.AreEqual(expectedResult, result);

            selection      = new SelectionConcrete(SelectionType.Many, SelectionObjectType.Face, "testMessage", "testPrefix");
            expectedResult = "Surfaces";
            result         = selection.GetOutputPortName();
            Assert.AreEqual(expectedResult, result);

            //Case ObjectType: PointOnFace
            selection      = new SelectionConcrete(SelectionType.One, SelectionObjectType.PointOnFace, "testMessage", "testPrefix");
            expectedResult = "Point";
            result         = selection.GetOutputPortName();
            Assert.AreEqual(expectedResult, result);

            selection      = new SelectionConcrete(SelectionType.Many, SelectionObjectType.PointOnFace, "testMessage", "testPrefix");
            expectedResult = "Points";
            result         = selection.GetOutputPortName();
            Assert.AreEqual(expectedResult, result);

            //Case ObjectType: None
            selection      = new SelectionConcrete(SelectionType.One, SelectionObjectType.None, "testMessage", "testPrefix");
            expectedResult = "Element";
            result         = selection.GetOutputPortName();
            Assert.AreEqual(expectedResult, result);

            selection      = new SelectionConcrete(SelectionType.Many, SelectionObjectType.None, "testMessage", "testPrefix");
            expectedResult = "Elements";
            result         = selection.GetOutputPortName();
            Assert.AreEqual(expectedResult, result);
        }