示例#1
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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }