예제 #1
0
        public void GetProperty_WithFactory_ShouldReturnCorrectValue(
            SampleBindable sut,
            string expected)
        {
            //arrange

            //act
            var actual = sut.GetPropertyWithFactory(() => expected);

            //assert
            actual.Should().Be(expected);
        }
예제 #2
0
		public void SetProperty_WithSameValue_ShouldNotRaiseNotifyPropertyChanged(
			SampleBindable sut,
			string value1)
		{
			//arrange
			sut.Property = value1;
			sut.MonitorEvents();

			//act
			sut.Property = value1;

			//assert
			sut.ShouldNotRaise("PropertyChanged");
		}
예제 #3
0
        public void SetProperty_WithSameValue_ShouldNotRaiseNotifyPropertyChanged(
            SampleBindable sut,
            string value1)
        {
            //arrange
            sut.Property = value1;
            sut.MonitorEvents();

            //act
            sut.Property = value1;

            //assert
            sut.ShouldNotRaise("PropertyChanged");
        }
예제 #4
0
		public void SetProperty_WithNewValue_ShouldRaiseNotifyPropertyChanged(
			SampleBindable sut,
			string value1,
			string value2)
		{
			//arrange
			sut.Property = value1;
			sut.MonitorEvents();

			//act
			sut.Property = value2;

			//assert
			sut.ShouldRaise("PropertyChanged").WithArgs<PropertyChangedEventArgs>(arg => arg.PropertyName == "Property");
		}
예제 #5
0
        public void SetProperty_WithNewValue_ShouldRaiseNotifyPropertyChanged(
            SampleBindable sut,
            string value1,
            string value2)
        {
            //arrange
            sut.Property = value1;
            sut.MonitorEvents();

            //act
            sut.Property = value2;

            //assert
            sut.ShouldRaise("PropertyChanged").WithArgs <PropertyChangedEventArgs>(arg => arg.PropertyName == "Property");
        }
예제 #6
0
        public void Invalidate_ShouldResetValue(
            SampleBindable sut,
            string value1,
            object value2)
        {
            //arrange
            sut.Property  = value1;
            sut.Property2 = value2;

            //act
            sut.CallInvalidate(() => sut.Property, () => sut.Property2);

            //assert
            sut.Property.Should().Be(default(string));
            sut.Property2.Should().Be(default(object));
        }
예제 #7
0
		public void Invalidate_ShouldResetValue(
		  SampleBindable sut,
			string value1,
			object value2)
		{
			//arrange
			sut.Property = value1;
			sut.Property2 = value2;

			//act
			sut.CallInvalidate(() => sut.Property, () => sut.Property2);

			//assert
			sut.Property.Should().Be(default(string));
			sut.Property2.Should().Be(default(object));
		}
예제 #8
0
		public void TestProperty(
			SampleBindable sut,
			WritablePropertyAssertion assertion)
		{
			assertion.VerifyProperty(() => sut.Property);
		}
예제 #9
0
		public void GetProperty_WithFactory_ShouldReturnCorrectValue(
		  SampleBindable sut,
			string expected)
		{
			//arrange

			//act
			var actual = sut.GetPropertyWithFactory(() => expected);

			//assert
			actual.Should().Be(expected);
		}
예제 #10
0
 public void TestProperty(
     SampleBindable sut,
     WritablePropertyAssertion assertion)
 {
     assertion.VerifyProperty(() => sut.Property);
 }