Пример #1
0
        public void MonitorForeignEvent()
        {
            var sc1 = new SimpleContainer();
            var sc2 = new SimpleContainer();

            sc2.DelegatePropertyChangeFrom(sc1, "Value", "Value");

            using (var foo = INPCCounter.VerifyInpcFired(sc2, o => o.Value))
            {
                sc1.Value = "This is not the default value";
            }
        }
Пример #2
0
        public void DelegateChange()
        {
            var sc1 = new SimpleContainer();
            var sc2 = new SimpleContainer();

            sc2.DelegatePropertyChangeFrom(sc1, "Value", "Value");
            var invoked = 0;

            sc2.PropertyChanged += (s, e) => invoked++;
            Assert.Equal(0, invoked);
            sc1.Value = "foo";
            Assert.Equal(1, invoked);
        }