Exemple #1
0
        public void EmptyErrorMessageValueIsWhatErrorInterfaceReturns()
        {
            var sut         = new EditorComponentVM <string>();
            var implicitSut = (IDataErrorInfo)sut;

            const string error = "error";

            // act
            sut.SetError(error);
            sut.SetError(String.Empty);

            // assert
            implicitSut.Error.Should().Be(null);
            implicitSut["Value"].Should().Be(null);
        }
Exemple #2
0
        public void SetErrorRaisesPropertyChangeNotification()
        {
            var sut = new EditorComponentVM <string>();

            const string error = "error";

            // act
            sut.MonitorEvents();
            sut.SetError(error);

            // assert
            sut.ShouldRaisePropertyChangeFor(x => x.Value);
        }