protected override async Task <ContractExecutionResult> ProcessAsyncEx <T>(T item) { var request = item as DesignDataRequest; if (request == null) { ThrowRequestTypeCastException <DesignDataRequest>(); } var siteModel = GetSiteModel(request.ProjectUid); var alignmentDesignStationRangeRequest = new AlignmentDesignStationRangeRequest(); var referenceDesign = new DesignOffset(request.DesignUid, 0.0); var alignmentDesignStationRangeResponse = await alignmentDesignStationRangeRequest.ExecuteAsync(new DesignSubGridRequestArgumentBase() { ProjectID = siteModel.ID, ReferenceDesign = referenceDesign }); if (alignmentDesignStationRangeResponse != null && alignmentDesignStationRangeResponse.RequestResult == DesignProfilerRequestResult.OK) { return(new AlignmentStationRangeResult(alignmentDesignStationRangeResponse.StartStation, alignmentDesignStationRangeResponse.EndStation)); } throw new ServiceException(HttpStatusCode.BadRequest, new ContractExecutionResult(ContractExecutionStatesEnum.FailedToGetResults, "Failed to get requested Alignment Design station range data.")); }
public async Task Test_AlignmentDesignStationRangeRequest() { AddDesignProfilerGridRouting(); var siteModel = DITAGFileAndSubGridRequestsWithIgniteFixture.NewEmptyModel(); var designUid = DITAGFileAndSubGridRequestsWithIgniteFixture.AddSVLAlignmentDesignToSiteModel(ref siteModel, TestHelper.CommonTestDataPath, "Large Sites Road - Trimble Road.svl"); var referenceDesign = new DesignOffset(designUid, 0); var request = new AlignmentDesignStationRangeRequest(); var response = await request.ExecuteAsync(new DesignSubGridRequestArgumentBase { ProjectID = siteModel.ID, ReferenceDesign = referenceDesign, Filters = new FilterSet(new CombinedFilter()), TRexNodeID = Guid.NewGuid() }); // TODO To complete this test later once an alignment design implementation becomes available on a .Net standard version of the Symphony SDK response.RequestResult.Should().Be(DesignProfilerRequestResult.OK); }
public void Test_AlignmentDesignStationRangeRequest_Creation() { var request = new AlignmentDesignStationRangeRequest(); request.Should().NotBeNull(); }