Пример #1
0
        public void WriteTest()
        {
            var propertyChangedEventCount = 0;
            var vm = new AutoMapViewModel();

            vm.PropertyChanged += (s, a) => propertyChangedEventCount++;

            vm.SetValue("Name", "TestOfficer");
            vm.SetValue("Age", 30);
            vm.SetValue("IsAdmin", false);

            Assert.AreEqual(3, propertyChangedEventCount);
            Assert.AreEqual("TestOfficer", vm.Data.Name);
            Assert.AreEqual(30, vm.Data.Age);
            Assert.AreEqual(false, vm.Data.IsAdmin);
        }