Exemple #1
0
        public void WhenListenerIsDisposed_ThenCallbackIsNoLongerInvoked()
        {
            bool wasCalled = false;
            var  target    = new NotifyingSampleObject()
            {
                Child = new NotifyingSampleObject()
                {
                    Value = "foo"
                }
            };

            var listener = new PropertyChangedHelper().BuildListener(target, x => x.Child.Value, () => wasCalled = true);

            listener.Dispose();

            target.Child.Value = "bar";

            Assert.IsFalse(wasCalled);
        }