public virtual ApiSpecialOfferResponseModel MapBOToModel( BOSpecialOffer boSpecialOffer) { var model = new ApiSpecialOfferResponseModel(); model.SetProperties(boSpecialOffer.SpecialOfferID, boSpecialOffer.Category, boSpecialOffer.Description, boSpecialOffer.DiscountPct, boSpecialOffer.EndDate, boSpecialOffer.MaxQty, boSpecialOffer.MinQty, boSpecialOffer.ModifiedDate, boSpecialOffer.Rowguid, boSpecialOffer.StartDate, boSpecialOffer.Type); return(model); }
public void MapResponseToRequest() { var mapper = new ApiSpecialOfferModelMapper(); var model = new ApiSpecialOfferResponseModel(); model.SetProperties(1, "A", "A", 1m, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, 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"), "A"); ApiSpecialOfferRequestModel response = mapper.MapResponseToRequest(model); response.Category.Should().Be("A"); response.Description.Should().Be("A"); response.DiscountPct.Should().Be(1m); response.EndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.MaxQty.Should().Be(1); response.MinQty.Should().Be(1); 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.Type.Should().Be("A"); }