public void MapBOToModelList() { var mapper = new BOLSalesTerritoryHistoryMapper(); BOSalesTerritoryHistory bo = new BOSalesTerritoryHistory(); bo.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), DateTime.Parse("1/1/1987 12:00:00 AM"), 1); List <ApiSalesTerritoryHistoryResponseModel> response = mapper.MapBOToModel(new List <BOSalesTerritoryHistory>() { { bo } }); response.Count.Should().Be(1); }
public void MapModelToBO() { var mapper = new BOLSalesTerritoryHistoryMapper(); ApiSalesTerritoryHistoryRequestModel model = new ApiSalesTerritoryHistoryRequestModel(); model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), DateTime.Parse("1/1/1987 12:00:00 AM"), 1); BOSalesTerritoryHistory response = mapper.MapModelToBO(1, model); response.EndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); response.StartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.TerritoryID.Should().Be(1); }
public void MapBOToModel() { var mapper = new BOLSalesTerritoryHistoryMapper(); BOSalesTerritoryHistory bo = new BOSalesTerritoryHistory(); bo.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), DateTime.Parse("1/1/1987 12:00:00 AM"), 1); ApiSalesTerritoryHistoryResponseModel response = mapper.MapBOToModel(bo); response.BusinessEntityID.Should().Be(1); response.EndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); response.StartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.TerritoryID.Should().Be(1); }
public void MapEFToBO() { var mapper = new DALSalesTerritoryHistoryMapper(); SalesTerritoryHistory entity = new SalesTerritoryHistory(); entity.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), DateTime.Parse("1/1/1987 12:00:00 AM"), 1); BOSalesTerritoryHistory response = mapper.MapEFToBO(entity); response.BusinessEntityID.Should().Be(1); response.EndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); response.StartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.TerritoryID.Should().Be(1); }