public void ShouldNotFirePropertyChangedAssertionFromLamdaNameReference() { var model = new SampleModel(); model.ShouldNotFirePropertyChanged<SampleModel>(() => model.FireTextProperty(0), m => m.Text, m => m.Number); Should.Throw<AssertionException>(() => model.ShouldNotFirePropertyChanged<SampleModel>(() => { model.Text = "Hello"; model.Number++; }, m => m.Text, m => m.Number)); }
public void ShouldNotFirePropertyChangedAssertion() { var model = new SampleModel(); model.ShouldNotFirePropertyChanged(() => model.FireTextProperty(0), SampleModel.PropText); model.ShouldNotFirePropertyChanged(() => model.FireTextProperty(0), SampleModel.PropText, SampleModel.PropNumber); Should.Throw<AssertionException>(() => model.ShouldNotFirePropertyChanged(() => { model.Text = "Hello"; model.Number++; }, SampleModel.PropText, SampleModel.PropNumber)); }