Пример #1
0
        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);
        }
Пример #2
0
        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);
        }