public virtual ApiTransactionHistoryResponseModel MapBOToModel( BOTransactionHistory boTransactionHistory) { var model = new ApiTransactionHistoryResponseModel(); model.SetProperties(boTransactionHistory.TransactionID, boTransactionHistory.ActualCost, boTransactionHistory.ModifiedDate, boTransactionHistory.ProductID, boTransactionHistory.Quantity, boTransactionHistory.ReferenceOrderID, boTransactionHistory.ReferenceOrderLineID, boTransactionHistory.TransactionDate, boTransactionHistory.TransactionType); return(model); }
public void MapResponseToRequest() { var mapper = new ApiTransactionHistoryModelMapper(); var model = new ApiTransactionHistoryResponseModel(); model.SetProperties(1, 1m, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, 1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A"); ApiTransactionHistoryRequestModel response = mapper.MapResponseToRequest(model); response.ActualCost.Should().Be(1m); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.ProductID.Should().Be(1); response.Quantity.Should().Be(1); response.ReferenceOrderID.Should().Be(1); response.ReferenceOrderLineID.Should().Be(1); response.TransactionDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.TransactionType.Should().Be("A"); }