public void SettingIsVisibleShouldNotRaiseEventWhenIsLoadingIsNotChanged() { // Arrange var received = false; var sut = new TestOption(); sut.IsLoadingChanged += (s, e) => received = true; // Act sut.SetIsLoading(sut.IsLoading); // Assert Assert.False(received); }
public void SettingIsLoadingShouldRaiseEvent() { // Arrange var sut = new TestOption(); // Act var evt = Assert.RaisesAny <EventArgs>( e => sut.IsLoadingChanged += e, e => sut.IsLoadingChanged -= e, () => sut.SetIsLoading(!sut.IsLoading)); // Assert Assert.NotNull(evt); Assert.Same(sut, evt.Sender); Assert.Equal(EventArgs.Empty, evt.Arguments); }