Esempio n. 1
0
        public void TestRaiseProperty()
        {
            int eventCount = 0;
            var bindable   = new DummyBindable();

            Assert.IsFalse(bindable.IsChanged);
            bindable.PropertyChanged += (sender, e) => eventCount++;
            bindable.Raise("test");
            Assert.IsTrue(bindable.IsChanged);
            Assert.AreEqual(1, eventCount);
        }
Esempio n. 2
0
        public void TestIgnoreEvents()
        {
            // Arrange
            int eventCount = 0;
            var bindable   = new DummyBindable();

            Assert.IsFalse(bindable.IsChanged);
            bindable.PropertyChanged += (sender, e) => eventCount++;

            // Act
            bindable.IgnoreEvents = true;
            bindable.Raise("test");
            bindable.IgnoreEvents = false;

            // Assert
            Assert.IsTrue(bindable.IsChanged);
            Assert.AreEqual(0, eventCount);
        }