Example #1
0
        public void CreateInputNetworkPort_Returns_Null_When_Parent_Element_Param_Is_Null()
        {
            //Arrange
            var fac = new PortFactory();

            //Act
            IInputNetworkPort port = fac.CreateInputNetworkPort(Guid.Empty, null);

            //Assert
            Assert.Null(port);
        }
Example #2
0
        public void CreateInputDataPort_Returns_Instance()
        {
            //Arrange
            var fac = new PortFactory();
            Guid id = Guid.NewGuid();
            var mockElement = new Mock<IElement>();

            //Act
            IInputDataPort port = fac.CreateInputDataPort(id, mockElement.Object);

            //Assert
            Assert.Equal(id, port.Id);
            Assert.NotNull(port);
        }
        private IInputPortMgr CreateInputPortMgr(IElement parent, Guid mgrId, Guid port0Id)
        {
            IInputPortMgr inPortMgr = null;
            IInputDataPort inPort = null;

            using (PortMgrFactory fac = new PortMgrFactory())
            {
                inPortMgr = fac.CreateInputPortMgr();
            }

            using (PortFactory fac = new PortFactory())
            {
                inPort = fac.CreateInputDataPort(port0Id, parent);
            }

            inPortMgr.Add(inPort);

            return inPortMgr;
        }
        private IInputPortMgr CreateInputPortMgr(IElement parent)
        {
            IInputPortMgr inPortMgr = null;
            IInputDataPort inPort = null;

            using (PortMgrFactory fac = new PortMgrFactory())
            {
                inPortMgr = fac.CreateInputPortMgr();
            }

            Guid id = Guid.NewGuid();
            using (PortFactory fac = new PortFactory())
            {
                inPort = fac.CreateInputDataPort(id, parent);
            }

            inPortMgr.Add(inPort);

            return inPortMgr;
        }
        private IOutputPortMgr CreateOutputPortMgr(IElement parent, Guid mgrId, Guid port0Id)
        {
            IOutputPortMgr outPortMgr = null;
            IOutputNetworkPort outPort = null;

            using (PortMgrFactory fac = new PortMgrFactory())
            {
                outPortMgr = fac.CreateOutputPortMgr();
            }

            using (PortFactory fac = new PortFactory())
            {
                outPort = fac.CreateOutputNetworkPort(port0Id, parent);
            }

            outPortMgr.Add(outPort);

            return outPortMgr;
        }
        private IOutputPortMgr CreateOutputPortMgr(IElement parent)
        {
            IOutputPortMgr outPortMgr = null;
            IOutputNetworkPort outPort = null;

            using (PortMgrFactory fac = new PortMgrFactory())
            {
                outPortMgr = fac.CreateOutputPortMgr();
            }

            Guid id = Guid.NewGuid();
            using (PortFactory fac = new PortFactory())
            {
                outPort = fac.CreateOutputNetworkPort(id, parent);
            }

            outPortMgr.Add(outPort);

            return outPortMgr;
        }
Example #7
0
        public void CreateOutputNetworkPort_Returns_Instance()
        {
            //Arrange
            var fac = new PortFactory();
            Guid id = Guid.NewGuid();
            var mockElement = new Mock<IElement>();

            //Act
            IOutputNetworkPort port = fac.CreateOutputNetworkPort(id, mockElement.Object);

            //Assert
            Assert.NotNull(port);
            Assert.Equal(id, port.Id);

            IBackingStore store = (port as OutputNetworkPort).Store;
            Assert.NotNull(store);
        }