Пример #1
0
        public void SetIsSelected_Updates_The_Is_Selected_Flag_If_The_Value_Changes()
        {
            //Arrange
            var _pipe = new NetworkPipe();
            // origin will not effect of the flag is updated. ,just may not allow the event to be fired.
            SelectionSource source = SelectionSource.Mouse;
            SelectionOrigin origin = SelectionOrigin.None;

            Assert.False(_pipe.IsSelected);

            _pipe.SetIsSelected(true, source, origin);

            Assert.True(_pipe.IsSelected);
        }
Пример #2
0
        public void SetIsSelected_Fires_SelectionChangedEvent_If_The_Selection_Origin_Is_Business()
        {
            //Arrange
            var _pipe = new NetworkPipe();
            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);
        }