public void NotifyOfPropertyChangedWithExpressionRaises() { var pc = new PropertyChanged(); string changedProperty = null; pc.PropertyChanged += (o, e) => changedProperty = e.PropertyName; pc.RaiseIntPropertyChangedWithExpression(); Assert.AreEqual("IntProperty", changedProperty); }
public void NotifyOfPropertyChangedWithExpressionRaises() { var pc = new PropertyChanged(); string changedProperty = null; pc.PropertyChanged += (o, e) => changedProperty = e.PropertyName; pc.RaiseIntPropertyChangedWithExpression(); Assert.AreEqual("IntProperty", changedProperty); }
public void UsesDispatcher() { var pc = new PropertyChanged(); string changedProperty = null; pc.PropertyChanged += (o, e) => changedProperty = e.PropertyName; Action action = null; pc.PropertyChangedDispatcher = a => action = a; pc.RaiseIntPropertyChangedWithExpression(); Assert.IsNull(changedProperty); Assert.IsNotNull(action); action(); Assert.AreEqual("IntProperty", changedProperty); }
public void UsesDispatcher() { var pc = new PropertyChanged(); string changedProperty = null; pc.PropertyChanged += (o, e) => changedProperty = e.PropertyName; Action action = null; pc.PropertyChangedDispatcher = a => action = a; pc.RaiseIntPropertyChangedWithExpression(); Assert.IsNull(changedProperty); Assert.IsNotNull(action); action(); Assert.AreEqual("IntProperty", changedProperty); }
public void UsesStaticDispatcherByDefault() { Action action = null; var oldDispatcher = Execute.DefaultPropertyChangedDispatcher; Execute.DefaultPropertyChangedDispatcher = a => action = a; var pc = new PropertyChanged(); string changedProperty = null; pc.PropertyChanged += (o, e) => changedProperty = e.PropertyName; pc.RaiseIntPropertyChangedWithExpression(); Assert.IsNull(changedProperty); Assert.IsNotNull(action); action(); Assert.AreEqual("IntProperty", changedProperty); Execute.DefaultPropertyChangedDispatcher = oldDispatcher; }
public void UsesStaticDispatcherByDefault() { Action action = null; var oldDispatcher = Execute.DefaultPropertyChangedDispatcher; Execute.DefaultPropertyChangedDispatcher = a => action = a; var pc = new PropertyChanged(); string changedProperty = null; pc.PropertyChanged += (o, e) => changedProperty = e.PropertyName; pc.RaiseIntPropertyChangedWithExpression(); Assert.IsNull(changedProperty); Assert.IsNotNull(action); action(); Assert.AreEqual("IntProperty", changedProperty); Execute.DefaultPropertyChangedDispatcher = oldDispatcher; }