public void OutputPort_ConnectionChanged()
        {
            IOutputNetworkPort port = new OutputNetworkPort();
            OutputPortMgr mgr = new OutputPortMgr();
            var helper = new HelperForOutputPortMgr();
            mgr.ConnectionChanged += helper.ConnectionChanged_DummyHandler;

            mgr.Add(port);

            INetworkPipe nPipe = _pipeFactory.CreateNetworkPipe();

            port.Add(nPipe);
            Assert.Equal(1, helper.ConnectionChanged_TimesCalled);
        }
        public void OutputPortMgrHandlesConnectionChangeEventFiredByIOutputNetworkPortWhenAConnectionChanged()
        {
            var port = new OutputNetworkPort();
            var mgr = new OutputPortMgr();
            var helper = new HelperForOutputPortMgr();
            mgr.ConnectionChanging += helper.ConnectionChanging_DummyHandler;
            mgr.ConnectionChanged += helper.ConnectionChanged_DummyHandler;

            mgr.Add(port);

            INetworkPipe dPipe = _pipeFactory.CreateNetworkPipe();

            port.Add(dPipe);

            Assert.Equal(1, helper.ConnectionChanging_TimesCalled);
        }
Ejemplo n.º 3
0
        public void SetIndex_Assigns_Port_Index_For_OutputNetworkPort()
        {
            //Arrange
            IPort port = new OutputNetworkPort();
            ISetIndex setter = port as ISetIndex;

            int initialIndex = port.Index;
            int actualIndex = 2;

            Assert.Equal(-1, initialIndex);

            //Act
            setter.SetIndex(actualIndex);

            //Assert
            int finalIndex = port.Index;

            Guid newId = Guid.NewGuid();
            Assert.Equal(actualIndex, finalIndex);
        }
 public void VerifyConnectionChangeEventHandlerIsImplementedForNetworkPipes()
 {
     // this just runs through event handlers to insure there are no notImplementedExceptions
     IOutputNetworkPort port = new OutputNetworkPort();
     OutputPortMgr mgr = new OutputPortMgr();
     mgr.Add(port);
     INetworkPipe nPipe = _pipeFactory.CreateNetworkPipe();
     port.Add(nPipe);
 }
Ejemplo n.º 5
0
        internal IOutputNetworkPort _CreateOutputNetworkPort(Guid portId, IElement parent)
        {
            if (parent == null)
                return null;

            IOutputNetworkPort port = new OutputNetworkPort(portId, parent);
            Guid storeId = Guid.NewGuid();

            ISetBackingStore setter = port as ISetBackingStore;
            using (BlueSpider.Motor.Providers.BackingStoreFactory fac = new BlueSpider.Motor.Providers.BackingStoreFactory())
            {
                IBackingStore store = fac.CreateNetworkBackingStore(storeId, BackingStoreType.InMemory);
                store.ParentId = portId;
                setter.SetBackingStore(store);
            }

            return port;
        }