public ONSData ONSDataToEntity(OnsPostcode onsPostcode) { return(new ONSData { EffectiveFrom = onsPostcode.EffectiveFrom, EffectiveTo = onsPostcode.EffectiveTo, Lep1 = onsPostcode.Lep1, Lep2 = onsPostcode.Lep2, LocalAuthority = onsPostcode.LocalAuthority, Nuts = onsPostcode.Nuts, Termination = GetEndOfMonthDateFromYearMonthString(onsPostcode.Termination) }); }
public void ONSDataToEntity() { var onsPostcode = new OnsPostcode { LocalAuthority = "Authority", Lep1 = "Lep1", Lep2 = "Lep2", Nuts = "Nuts", Termination = "202008", EffectiveFrom = new DateTime(2018, 8, 1) }; var onsData = new ONSData { LocalAuthority = "Authority", Lep1 = "Lep1", Lep2 = "Lep2", Nuts = "Nuts", Termination = new DateTime(2020, 8, 31), EffectiveFrom = new DateTime(2018, 8, 1) }; NewMapper().ONSDataToEntity(onsPostcode).Should().BeEquivalentTo(onsData); }