public void DerivedDependencyObjectObservableForPropertySmokeTest()
        {
            var fixture = new DerivedDepObjFixture();
            var binder = new DependencyObjectObservableForProperty();
            Assert.NotEqual(0, binder.GetAffinityForObject(typeof (DerivedDepObjFixture), "TestString"));
            Assert.Equal(0, binder.GetAffinityForObject(typeof (DerivedDepObjFixture), "DoesntExist"));

            var results = new List<IObservedChange<object, object>>();
            var disp1 = binder.GetNotificationForProperty(fixture, "TestString").Subscribe(results.Add);
            var disp2 = binder.GetNotificationForProperty(fixture, "TestString").Subscribe(results.Add);

            fixture.TestString = "Foo";
            fixture.TestString = "Bar";

            Assert.Equal(4, results.Count);

            disp1.Dispose();
            disp2.Dispose();
        }
Exemple #2
0
        public void DerivedDependencyObjectObservableForPropertySmokeTest()
        {
            var fixture = new DerivedDepObjFixture();
            var binder  = new DependencyObjectObservableForProperty();

            Assert.NotEqual(0, binder.GetAffinityForObject(typeof(DerivedDepObjFixture), "TestString"));
            Assert.Equal(0, binder.GetAffinityForObject(typeof(DerivedDepObjFixture), "DoesntExist"));

            var results = new List <IObservedChange <object, object> >();
            var disp1   = binder.GetNotificationForProperty(fixture, "TestString").Subscribe(results.Add);
            var disp2   = binder.GetNotificationForProperty(fixture, "TestString").Subscribe(results.Add);

            fixture.TestString = "Foo";
            fixture.TestString = "Bar";

            Assert.Equal(4, results.Count);

            disp1.Dispose();
            disp2.Dispose();
        }