Example #1
0
        public Task <ContractExecutionResult> GetAlignmentGeometryForRendering([FromQuery] Guid projectUid, [FromQuery] Guid designUid, [FromQuery] string fileName,
                                                                               [FromQuery] bool convertArcsToChords, [FromQuery] double arcChordTolerance)
        {
            Log.LogInformation($"{nameof(GetAlignmentGeometryForRendering)}: projectUid:{projectUid}, designUid:{designUid}, fileName:{fileName}");

            var alignmentMasterGeometryRequest = new AlignmentDesignGeometryRequest(projectUid, designUid, fileName, convertArcsToChords, arcChordTolerance);

            alignmentMasterGeometryRequest.Validate();

            return(WithServiceExceptionTryExecuteAsync(() =>
                                                       RequestExecutorContainer
                                                       .Build <AlignmentMasterGeometryExecutor>(ConfigStore, LoggerFactory, ServiceExceptionHandler)
                                                       .ProcessAsync(alignmentMasterGeometryRequest)));
        }
Example #2
0
        public async Task AlignmentMasterGeometryExecutor_SiteModelNotFound()
        {
            const string FILE_NAME = "Test.svl";

            var projectUid = Guid.NewGuid();

            var request = new AlignmentDesignGeometryRequest(projectUid, Guid.NewGuid(), FILE_NAME);

            request.Validate();

            var executor = RequestExecutorContainer
                           .Build <AlignmentMasterGeometryExecutor>(
                DIContext.Obtain <IConfigurationStore>(),
                DIContext.Obtain <ILoggerFactory>(),
                DIContext.Obtain <IServiceExceptionHandler>());

            var result = await Assert.ThrowsAsync <ServiceException>(() => executor.ProcessAsync(request));

            Assert.Equal(HttpStatusCode.BadRequest, result.Code);
            Assert.Equal(ContractExecutionStatesEnum.InternalProcessingError, result.GetResult.Code);
            Assert.Equal($"Site model {projectUid} is unavailable", result.GetResult.Message);
        }