コード例 #1
0
        public void AnyChangeInExpressionListTriggersUpdate()
        {
            var  obj = new ObjChain1();
            bool obsUpdated;

            obj.ObservableForProperty(x => x.Model.Model.Model.SomeOtherParam).Subscribe(_ => obsUpdated = true);

            obsUpdated = false;
            obj.Model.Model.Model.SomeOtherParam = 42;
            Assert.True(obsUpdated);

            obsUpdated            = false;
            obj.Model.Model.Model = new HostTestFixture();
            Assert.True(obsUpdated);

            obsUpdated      = false;
            obj.Model.Model = new ObjChain3()
            {
                Model = new HostTestFixture()
                {
                    SomeOtherParam = 10
                }
            };
            Assert.True(obsUpdated);

            obsUpdated = false;
            obj.Model  = new ObjChain2();
            Assert.True(obsUpdated);
        }
コード例 #2
0
        public void AnyChangeInExpressionListTriggersUpdate()
        {
            var obj = new ObjChain1();
            bool obsUpdated;
            obj.ObservableForProperty(x => x.Model.Model.Model.SomeOtherParam).Subscribe(_ => obsUpdated = true);

            obsUpdated = false;
            obj.Model.Model.Model.SomeOtherParam = 42;
            Assert.True(obsUpdated);

            obsUpdated = false;
            obj.Model.Model.Model = new HostTestFixture();
            Assert.True(obsUpdated);

            obsUpdated = false;
            obj.Model.Model = new ObjChain3() {Model = new HostTestFixture() {SomeOtherParam = 10 } } ;
            Assert.True(obsUpdated);

            obsUpdated = false;
            obj.Model = new ObjChain2();
            Assert.True(obsUpdated);
        }