public void ViewModelMultipleAssignDifferentValuePropertyChangesShouldBeMore() { var valuePropertyViewModel = new ValuePropertyViewModel(); var propertyChanged = false; valuePropertyViewModel.PropertyChanged += (s, e) => propertyChanged = true; valuePropertyViewModel.Changed.Should().BeFalse(); const int Value = 3; valuePropertyViewModel.Value = Value; valuePropertyViewModel.Value = Value; valuePropertyViewModel.Value.Should().Be(Value); valuePropertyViewModel.Changes.Should().Be(1); valuePropertyViewModel.Changed.Should().BeTrue(); propertyChanged.Should().BeTrue(); }
public void ViewModelMultipleAssignDifferentValuePropertyChangesShouldBeMore() { var valuePropertyViewModel = new ValuePropertyViewModel(); var propertyChanged = false; valuePropertyViewModel.PropertyChanged += (s, e) => propertyChanged = true; valuePropertyViewModel.Changed.Should().Be.False(); const int Value = 3; valuePropertyViewModel.Value = Value; valuePropertyViewModel.Value = Value; valuePropertyViewModel.Value.Should().Be.EqualTo(Value); valuePropertyViewModel.Changes.Should().Be.EqualTo(1); valuePropertyViewModel.Changed.Should().Be.True(); propertyChanged.Should().Be.True(); }