public void MapBOToModelList() { var mapper = new BOLEmployeePayHistoryMapper(); BOEmployeePayHistory bo = new BOEmployeePayHistory(); bo.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1m, DateTime.Parse("1/1/1987 12:00:00 AM")); List <ApiEmployeePayHistoryResponseModel> response = mapper.MapBOToModel(new List <BOEmployeePayHistory>() { { bo } }); response.Count.Should().Be(1); }
public void MapModelToBO() { var mapper = new BOLEmployeePayHistoryMapper(); ApiEmployeePayHistoryRequestModel model = new ApiEmployeePayHistoryRequestModel(); model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1m, DateTime.Parse("1/1/1987 12:00:00 AM")); BOEmployeePayHistory response = mapper.MapModelToBO(1, model); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.PayFrequency.Should().Be(1); response.Rate.Should().Be(1m); response.RateChangeDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); }
public void MapBOToModel() { var mapper = new BOLEmployeePayHistoryMapper(); BOEmployeePayHistory bo = new BOEmployeePayHistory(); bo.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1m, DateTime.Parse("1/1/1987 12:00:00 AM")); ApiEmployeePayHistoryResponseModel response = mapper.MapBOToModel(bo); response.BusinessEntityID.Should().Be(1); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.PayFrequency.Should().Be(1); response.Rate.Should().Be(1m); response.RateChangeDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); }
public void MapEFToBO() { var mapper = new DALEmployeePayHistoryMapper(); EmployeePayHistory entity = new EmployeePayHistory(); entity.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1m, DateTime.Parse("1/1/1987 12:00:00 AM")); BOEmployeePayHistory response = mapper.MapEFToBO(entity); response.BusinessEntityID.Should().Be(1); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.PayFrequency.Should().Be(1); response.Rate.Should().Be(1m); response.RateChangeDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); }