public void LoadCustomer(Customer customer) { this.Name = string.Format("{0} {1}",customer.FirstName,customer.LastName); this.Address1 = customer.Address1; this.Address2 = customer.Address2; this.City = customer.City; this.State = customer.State; this.Zip = customer.Zip; }
public void Mapping() { CustomerMapper.Bootstrap(); AutoMapper.Mapper.AssertConfigurationIsValid(); var customer = new Customer { FirstName = "Juan", LastName = "Perez", Address1 = "Home 1", Address2 = "Belatrix", State = "Lima", City = "LIma", Zip = "0051" }; var customerInfo = AutoMapper.Mapper.Map<Customer, CustomerInfoViewModel>(customer); Assert.AreEqual("Home 1",customerInfo.Address1); }