public static Resident ToDomain(this UHResident resident) { var residentDateOfBirth = resident.DateOfBirth == new DateTime(1900, 01, 01) ? (DateTime?)null : resident.DateOfBirth; return(new Resident { Title = resident.Title, FirstName = resident.FirstName, LastName = resident.LastName, DateOfBirth = residentDateOfBirth, PersonNumber = resident.PersonNumber, Responsible = resident.Responsible }); }
public void ToDomainWillMapAResident() { var dbResident = new UHResident { Title = "miss", FirstName = "first name", LastName = "last name", DateOfBirth = new DateTime(1980, 12, 28), PersonNumber = 4, Responsible = false }; dbResident.ToDomain().Should().BeEquivalentTo(new Resident { Title = "miss", FirstName = "first name", LastName = "last name", DateOfBirth = new DateTime(1980, 12, 28), PersonNumber = 4, Responsible = false }); }