Пример #1
0
 /// <summary>
 /// Triggers the ConnectionChanging event.
 /// </summary>
 public virtual void OnConnectionChanging(ConnectionChangingEventArgs ea)
 {
     if (ConnectionChanging != null)
         ConnectionChanging(this, ea);
 }
Пример #2
0
 internal override void _outPortMgr_ConnectionChanging(IOutputPortMgr sender, ConnectionChangingEventArgs ea)
 {
     _outPortMgr_ConnectionChanging_TimesCalled++;
 }
Пример #3
0
 internal void OutputPort_ConnectionChanging(IOutputPort sender, ConnectionChangingEventArgs ea)
 {
     if (sender == null)
         return;
     OnConnectionChanging(ea);
 }
Пример #4
0
 public void ConnectionChanging_DummyHandler(IInputPortMgr sender, ConnectionChangingEventArgs ea)
 {
     ConnectionChanging_TimesCalled++;
     RecievedEventArgs = ea;
     RecievedSender = sender;
 }
Пример #5
0
 public void ConnectionChanging_DummyHandler(IOutputNetworkPort sender, ConnectionChangingEventArgs ea)
 {
     ConnectionChanging_TimesCalled++;
     RecievedEventArgs = ea;
     RecievedSender = sender;
 }
Пример #6
0
 public void InputConnecting_DummyHandler(IInputNeutralPort sender, ConnectionChangingEventArgs ea)
 {
     InputConnecting_TimesCalled++;
     RecievedEventArgs = ea;
     RecievedSender = sender;
 }
Пример #7
0
 internal void _outPortMgr_ConnectionChanging(IOutputPortMgr sender, ConnectionChangingEventArgs ea)
 {
     // Do nothing here since there is no need to change the status of the element;
     // (used to throw a NotImplementedException here but it interfered with testing compound elements).
 }
Пример #8
0
 internal void _inPortMgr_ConnectionChanging(IInputPortMgr sender, ConnectionChangingEventArgs ea)
 {
     if (sender != null)
     {
         if (ea.Action != ConnectionAction.None)
         {
             // in all cases, the element state will go to incomplete.
             SetStatus(ElementStatus.Incomplete, StatusChangeDriver.NormalTransition, null);
         }
     }
 }
Пример #9
0
 internal void InputPort_ConnectionChanging(IInputPort sender, ConnectionChangingEventArgs ea)
 {
     if (sender == null)
         return;
     // this input mgr becomes the new sender for the next level up
     OnConnectionChanging(ea);
 }
Пример #10
0
 internal virtual void _outPortMgr_ConnectionChanging(IOutputPortMgr sender, ConnectionChangingEventArgs ea)
 {
     throw new NotImplementedException("The method or operation is not implemented.");
 }
        public void OutputPortMgrConnectionChangingEventHandlerUpdatesElementStateToIncompleteWhenActionIsReplace()
        {
            ElementStatus expectedStatus = ElementStatus.Incomplete;
            ConnectionAction action = ConnectionAction.Replace;
            ConnectionChangingEventArgs args = new ConnectionChangingEventArgs(action);
            var mockOutPortMgr = new Mock<IOutputPortMgr>();
            _el._outPortMgr_ConnectionChanging(mockOutPortMgr, args);

            ElementStatus actualStatus = _el.Status;

            Assert.Equal(expectedStatus, actualStatus);
        }