Catel.Test.Data.ModelBaseTest.NotifyPropertyChanged_OldValueSupport C# (CSharp) Метод

NotifyPropertyChanged_OldValueSupport() приватный Метод

private NotifyPropertyChanged_OldValueSupport ( ) : void
Результат void
        public void NotifyPropertyChanged_OldValueSupport()
        {
            var obj = new IniEntry();

            object oldValue = null;
            object newValue = null;

            obj.PropertyChanged += (sender, e) =>
                                       {
                                           var advancedE = (AdvancedPropertyChangedEventArgs)e;

                                           if (advancedE.PropertyName == "Key")
                                           {
                                               Assert.IsTrue(advancedE.IsOldValueMeaningful);
                                               Assert.IsTrue(advancedE.IsNewValueMeaningful);

                                               oldValue = advancedE.OldValue;
                                               newValue = advancedE.NewValue;
                                           }
                                       };

            obj.Key = "new value";

            Assert.AreEqual(IniEntry.KeyProperty.GetDefaultValue(), oldValue);
            Assert.AreEqual("new value", newValue);
        }
ModelBaseTest