public void Bindable_Set_DifferentValueWillSet() { TestBindableClass bindable = new TestBindableClass(); Assert.AreEqual(bindable.BindableBool, false); bindable.BindableBool = true; Assert.AreEqual(bindable.BindableBool, true); }
public void Bindable_RaisePropertyChanged_CallingRaisesPropertyChanged() { List <string> receivedEvents = new List <string>(); TestBindableClass bindable = new TestBindableClass(); bindable.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { receivedEvents.Add(e.PropertyName); }; bindable.RaisePropertyChanged(() => bindable.BindableBool); Assert.AreEqual(1, receivedEvents.Count); Assert.AreEqual(nameof(TestBindableClass.BindableBool), receivedEvents[0]); }
public void Bindable_Set_DifferentValueWillRaisePropertyChanged() { List <string> receivedEvents = new List <string>(); TestBindableClass bindable = new TestBindableClass(); bindable.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { receivedEvents.Add(e.PropertyName); }; Assert.AreEqual(bindable.BindableBool, false); bindable.BindableBool = true; Assert.AreEqual(1, receivedEvents.Count); Assert.AreEqual(nameof(TestBindableClass.BindableBool), receivedEvents[0]); }