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); }
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); }