コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 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);
 }