public virtual ApiWorkOrderRoutingResponseModel MapBOToModel( BOWorkOrderRouting boWorkOrderRouting) { var model = new ApiWorkOrderRoutingResponseModel(); model.SetProperties(boWorkOrderRouting.WorkOrderID, boWorkOrderRouting.ActualCost, boWorkOrderRouting.ActualEndDate, boWorkOrderRouting.ActualResourceHr, boWorkOrderRouting.ActualStartDate, boWorkOrderRouting.LocationID, boWorkOrderRouting.ModifiedDate, boWorkOrderRouting.OperationSequence, boWorkOrderRouting.PlannedCost, boWorkOrderRouting.ProductID, boWorkOrderRouting.ScheduledEndDate, boWorkOrderRouting.ScheduledStartDate); return(model); }
public void MapResponseToRequest() { var mapper = new ApiWorkOrderRoutingModelMapper(); var model = new ApiWorkOrderRoutingResponseModel(); model.SetProperties(1, 1m, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1m, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM")); ApiWorkOrderRoutingRequestModel response = mapper.MapResponseToRequest(model); response.ActualCost.Should().Be(1m); response.ActualEndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.ActualResourceHr.Should().Be(1); response.ActualStartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.LocationID.Should().Be(1); response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.OperationSequence.Should().Be(1); response.PlannedCost.Should().Be(1m); response.ProductID.Should().Be(1); response.ScheduledEndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.ScheduledStartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); }