public void SetContentAvailability_Fires_ContentChangedEvent() { //Arrange var _pipe = new NeutralPipe(); ISetContentAvailability setter = _pipe as ISetContentAvailability; HelperForPipes helper = new HelperForPipes(); _pipe.StatusChanged += new StatusChangeEventHandler<IPipe, PipeStatusChangeEventArgs>(helper.ContentStatusChange_DummyHandler); setter.SetContentAvailability(true); Assert.Equal(1, helper.ContentStatusChange_TimesCalled); }
public void SetIsSelected_Fires_SelectionChangedEvent_If_The_Selection_Origin_Is_Business() { //Arrange var _pipe = new NeutralPipe(); SelectionSource source = SelectionSource.Code; SelectionOrigin origin = SelectionOrigin.Business; HelperForPipes helper = new HelperForPipes(); _pipe.SelectionChanged += new SelectionEventHandler<IPipe, SelectionEventArgs>(helper.SelectionChanged_DummyHandler); _pipe.SetIsSelected(true, source, origin); Assert.True(_pipe.IsSelected); Assert.Equal(1, helper.SelectionChanged_TimesCalled); }
public void SetIsSelected_Does_Not_Fire_The_SelectionChangedEvent_If_The_Selection_Value_Does_Not_Change() { //Arrange var _pipe = new DataPipe(); SelectionSource source = SelectionSource.Code; SelectionOrigin origin = SelectionOrigin.Business; HelperForPipes helper = new HelperForPipes(); _pipe.SelectionChanged += new SelectionEventHandler<IPipe, SelectionEventArgs>(helper.SelectionChanged_DummyHandler); _pipe.SetIsSelected(false, source, origin); Assert.False(_pipe.IsSelected); Assert.Equal(0, helper.SelectionChanged_TimesCalled); }