Пример #1
0
        public void ViewModelBase_SetPropertySameData_isFalse()
        {
            ViewModelBaseTestClass modelBase = new ViewModelBaseTestClass();
            bool   wasCalled = true;
            string oldString = "1";
            string newString = "1";

            wasCalled = modelBase.ExposedSet(ref oldString, newString);

            Assert.IsFalse(wasCalled);
        }
Пример #2
0
        public void ViewModelBase_SetPropertyNewData_EventCalled()
        {
            ViewModelBaseTestClass modelBase = new ViewModelBaseTestClass();
            bool wasCalled = false;

            modelBase.PropertyChanged += (o, e) => { wasCalled = true; };
            string oldString = "1";
            string newString = "2";

            modelBase.ExposedSet(ref oldString, newString);

            Assert.IsTrue(wasCalled);
        }