public void SetErrorRaisesPropertyChangeNotification() { var sut = new EditorComponentVM <string>(); const string error = "error"; // act sut.MonitorEvents(); sut.SetError(error); // assert sut.ShouldRaisePropertyChangeFor(x => x.Value); }
public void SetValueRaisesPropertyChangeNotification() { var sut = new EditorComponentVM <string>(); var implicitSut = (IEditorComponent <string>)sut; const string sample = "sample"; // act sut.MonitorEvents(); implicitSut.SetValue(sample); // assert sut.ShouldRaisePropertyChangeFor(x => x.Value); }
public void EventIsRaisedWhenReadOnlyStateIsUpdated() { var sut = new EditorComponentVM <string>(); var implicitSut = (IEditorComponent <string>)sut; const bool isReadOnly = true; // act implicitSut.MonitorEvents(); implicitSut.SetReadOnly(isReadOnly); // assert sut.ShouldRaisePropertyChangeFor(x => x.IsReadOnly); sut.IsReadOnly.Should().Be(isReadOnly); }