Beispiel #1
0
        public void NotifyPropertyChangingDoesNotCallForEqualPropertyValue()
        {
            var changingTest = new ChangingTest();

            changingTest.PropertyChanging += (sender, e) => Assert.Fail("Not expected a propertychanging event");

            changingTest.NonCancallable = ChangingTest.NonCancallableProperty.GetDefaultValue <string>();
        }
Beispiel #2
0
        public void NotifyPropertyChangingPreventsSetValue()
        {
            var changingTest = new ChangingTest();

            Assert.AreEqual("non-cancallable", changingTest.NonCancallable);
            Assert.AreEqual("cancallable", changingTest.Cancallable);

            changingTest.NonCancallable = "test";
            changingTest.Cancallable    = "test";

            Assert.AreEqual("test", changingTest.NonCancallable);
            Assert.AreEqual("cancallable", changingTest.Cancallable);
        }
Beispiel #3
0
        public void NotifyPropertyChangingPreventsSetValue()
        {
            var changingTest = new ChangingTest();

            Assert.AreEqual("non-cancallable", changingTest.NonCancallable);
            Assert.AreEqual("cancallable", changingTest.Cancallable);

            changingTest.NonCancallable = "test";
            changingTest.Cancallable = "test";

            Assert.AreEqual("test", changingTest.NonCancallable);
            Assert.AreEqual("cancallable", changingTest.Cancallable);
        }
Beispiel #4
0
        public void NotifyPropertyChangingDoesNotCallForEqualPropertyValue()
        {
            var changingTest = new ChangingTest();
            changingTest.PropertyChanging += (sender, e) => Assert.Fail("Not expected a propertychanging event");

            changingTest.NonCancallable = ChangingTest.NonCancallableProperty.GetDefaultValue<string>();
        }