Пример #1
0
        public void the_assertion_succeeds_if_notification_is_raised()
        {
            var sut = new NotificationOnAllProperties();

            sut.AssertThatChangeNotificationIsRaisedBy(x => x.Int)
            .When(() => sut.Int = 99);
        }
Пример #2
0
 public void an_incomplete_assertion_will_fail()
 {
     Assert.Throws <Exception>(() => {
         var sut = new NotificationOnAllProperties();
         sut.AssertThatChangeNotificationIsRaisedBy(x => x.Int);
     });
 }
        public void can_test_a_single_property()
        {
            var sut = new NotificationOnAllProperties();

            sut.AssertThatProperty(x => x.String)
            .RaisesChangeNotification();
        }
        public void specific_values_can_be_set_on_individual_properties()
        {
            var sut = new NotificationOnAllProperties();

            sut.AssertThatAllProperties()
            .SetValue(x => x.String, "some_string").RaiseChangeNotification();

            sut.String.ShouldBe("some_string");
        }
        public void the_assertion_will_pass_if_notification_is_correct()
        {
            var sut = new NotificationOnAllProperties();

            sut.AssertThatAllProperties().RaiseChangeNotification();
        }