public virtual void ModeShouldDoNothingOnAttach()
        {
            bool isTargetInvoked = false;
            bool isSourceInvoked = false;

            BindingMock.UpdateTarget = () => isTargetInvoked = true;
            BindingMock.UpdateSource = () => isSourceInvoked = true;

            Behavior.Attach(BindingMock).ShouldBeTrue();
            isTargetInvoked.ShouldBeFalse();
            isSourceInvoked.ShouldBeFalse();
        }
        public virtual void ModeShouldUpdateSourceOnAttach()
        {
            bool isTargetInvoked = false;
            bool isSourceInvoked = false;

            BindingMock.UpdateTarget        = () => isTargetInvoked = true;
            BindingMock.UpdateSource        = () => isSourceInvoked = true;
            TargetSourceMock.GetPathMembers = b => new BindingPathMembersMock(SourceSourceMock, BindingPath.DataContext);

            Behavior.Attach(BindingMock).ShouldBeTrue();
            isTargetInvoked.ShouldBeFalse();
            isSourceInvoked.ShouldBeTrue();
        }
        public virtual void ModeShouldListenTargetChange()
        {
            bool isTargetInvoked = false;
            bool isSourceInvoked = false;

            BindingMock.UpdateTarget = () => isTargetInvoked = true;
            BindingMock.UpdateSource = () => isSourceInvoked = true;

            Behavior.Attach(BindingMock).ShouldBeTrue();
            isSourceInvoked = false;
            isTargetInvoked = false;

            TargetSourceMock.RaiseValueChanged();
            isTargetInvoked.ShouldBeFalse();
            isSourceInvoked.ShouldBeTrue();
        }
        public virtual void ModeShouldListenSourceChange()
        {
            SourceSourceMock.GetPathMembers = b => new BindingPathMembersMock(new object(), BindingPath.Empty);
            bool isTargetInvoked = false;
            bool isSourceInvoked = false;

            BindingMock.UpdateTarget = () => isTargetInvoked = true;
            BindingMock.UpdateSource = () => isSourceInvoked = true;

            Behavior.Attach(BindingMock).ShouldBeTrue();
            isSourceInvoked = false;
            isTargetInvoked = false;

            SourceSourceMock.RaiseValueChanged();
            isTargetInvoked.ShouldBeTrue();
            isSourceInvoked.ShouldBeFalse();
        }
        public void SetUp()
        {
            testListView = new ListView();
            testGridView = new GridView();
            testGridView.Columns.Add(new GridViewColumn {
                Header = "1"
            });
            testGridView.Columns.Add(new GridViewColumn {
                Header = "2"
            });
            testGridView.Columns.Add(new GridViewColumn {
                Header = "3"
            });
            ScrollViewer.SetVerticalScrollBarVisibility(testGridView, ScrollBarVisibility.Hidden);
            testListView.View = testGridView;

            testBehavior = new GridViewResizeBehavior();
            testBehavior.Attach(testListView);
        }