public void Constructor() { var vm = new AutoMapExceptViewModel(); Assert.IsNotNull(vm); Assert.IsNotNull(vm.Data); }
public void ReadTest() { var vm = new AutoMapExceptViewModel(); Assert.AreEqual(vm.Data.Name, vm.GetValue("Name")); Assert.AreEqual(vm.Data.IsAdmin, vm.GetValue("IsAdmin")); }
public void WriteTest() { var propertyChangedEventCount = 0; var vm = new AutoMapExceptViewModel(); vm.PropertyChanged += (s, a) => propertyChangedEventCount++; vm.SetValue("Name", "TestOfficer"); vm.SetValue("IsAdmin", false); Assert.AreEqual(2, propertyChangedEventCount); Assert.AreEqual("TestOfficer", vm.Data.Name); Assert.AreEqual(false, vm.Data.IsAdmin); }