public void OutputPortMgrHandlesConnectionChangeEventFiredByIOutputDataPortWhenAConnectionChanged()
        {
            var port = new OutputDataPort();
            var mgr = new OutputPortMgr();
            var helper = new HelperForOutputPortMgr();
            mgr.ConnectionChanging += helper.ConnectionChanging_DummyHandler;
            mgr.ConnectionChanged += helper.ConnectionChanged_DummyHandler;

            mgr.Add(port);

            IDataPipe dPipe = _pipeFactory.CreateDataPipe();

            port.Add(dPipe);

            Assert.Equal(1, helper.ConnectionChanging_TimesCalled);
            Assert.Equal(1, helper.ConnectionChanged_TimesCalled);
        }
Exemple #2
0
        internal IOutputDataPort _CreateOutputDataPort(Guid portId, IElement parent)
        {
            if (parent == null)
                return null;

            IOutputDataPort port = new OutputDataPort(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.CreateDataBackingStore(storeId, BackingStoreType.InMemory);
                store.ParentId = portId;
                setter.SetBackingStore(store);
            }
            return port;
        }
        public void SetIndex_Assigns_Port_Index_For_OutputDataPort()
        {
            //Arrange
            IPort port = new OutputDataPort();
            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 VerifyConnectionChangeEventHandlerIsImplementedForDataPipes()
 {
     // this just runs through event handlers to insure there are no notImplementedExceptions
     IOutputDataPort port = new OutputDataPort();
     OutputPortMgr mgr = new OutputPortMgr();
     mgr.Add(port);
     IDataPipe dPipe = _pipeFactory.CreateDataPipe();
     port.Add(dPipe);
 }