Exemplo n.º 1
0
        public void WHEN_property_is_not_different_and_action_has_been_set_SHOULD_not_call_action()
        {
            //Arrange
            var sut = new TestBindableObject(2);

            using (var changedProperties = sut.SubscribeToPropertyChanged <TestBindableObject, int>(x => x.SideEffect))
            {
                //Act
                sut.CountMeWithSideEffect = 2;
                sut.CountMeWithSideEffect = 2;
                sut.CountMeWithSideEffect = 2;

                //Assert
                Assert.AreEqual(0, changedProperties.Count);
            }
        }
Exemplo n.º 2
0
        public void WHEN_property_is_not_different_SHOULD_not_notify_changed()
        {
            //Arrange
            var sut = new TestBindableObject(2);

            using (var changedProperties = sut.SubscribeToPropertyChanged <TestBindableObject, int>(x => x.CountMe))
            {
                //Act
                sut.CountMe = 2;
                sut.CountMe = 2;
                sut.CountMe = 2;

                //Assert
                Assert.AreEqual(0, changedProperties.Count);
            }
        }