public void ConvertWithNullableIntToNullableIntProperty() { CustomerNullableInt customer = new CustomerNullableInt { Address = "Address1", City = "City1", Name = "Name1", State = "State1", Telephone = "Telephone1", TerritoryId = 0, ZipCode = 12345 }; EntityConverter <CustomerNullableInt, ContactNullableInt> converter = new EntityConverter <CustomerNullableInt, ContactNullableInt>((cu, co) => co.Phone = cu.Telephone); ContactNullableInt contact = converter.Convert(customer); Assert.IsNotNull(contact); }
public void ConvertWithDefaultValueForToEntityProperty() { CustomerNullableInt customer = new CustomerNullableInt { Address = "Address1", City = "City1", Name = "Name1", State = null, Telephone = "555-1212", TerritoryId = 0, ZipCode = 12345 }; EntityConverter <CustomerNullableInt, ContactNullableInt> converter = new EntityConverter <CustomerNullableInt, ContactNullableInt>((cu, co) => co.Phone = cu.Telephone); ContactNullableInt contact = converter.Convert(customer); Assert.IsNotNull(contact); Assert.AreEqual("WA", contact.State); }