Ejemplo n.º 1
0
        public void ConvertWithMapping()
        {
            List <Customer> customers = GetCustomers();

            EntityConverter <Customer, Contact> converter = new EntityConverter <Customer, Contact>();

            converter.AddMapping("Telephone", "Phone");
            IList <Contact> contacts = converter.Convert(customers);

            Assert.AreEqual(100, contacts.Count);
            Assert.AreEqual("TestCustomer1", contacts[0].Name);
            Assert.AreEqual("TestAddress1", contacts[0].Address);
            Assert.AreEqual("555-1212", contacts[0].Phone);
        }