Beispiel #1
0
        public void CompactionCellDatumExecutorSuccessNoNECoordinates()
        {
            var request =
                new CellDatumRequest(0, null, DisplayMode.CCV, new WGSPoint(0.84, -1.75), null, null, null, null);

            TCellProductionData data = new TCellProductionData
            {
                DisplayMode = (int)request.DisplayMode,
                Value       = 500,
                ReturnCode  = 0
            };

            var raptorClient = new Mock <IASNodeClient>();
            var configStore  = new Mock <IConfigurationStore>();

            raptorClient.Setup(x => x.GetCellProductionData(
                                   request.ProjectId.Value,
                                   (int)RaptorConverters.convertDisplayMode(request.DisplayMode),
                                   request.GridPoint != null ? request.GridPoint.x : 0.0,
                                   request.GridPoint != null ? request.GridPoint.y : 0.0,
                                   It.IsAny <TWGS84Point>(),
                                   request.LLPoint == null,
                                   It.IsAny <TICFilterSettings>(),
                                   It.IsAny <TICLiftBuildSettings>(),
                                   It.IsAny <TVLPDDesignDescriptor>(),
                                   out data))
            .Returns(true);

            var executor = RequestExecutorContainerFactory
                           .Build <CompactionCellDatumExecutor>(logger, raptorClient.Object, configStore: configStore.Object);

            Assert.ThrowsExceptionAsync <ServiceException>(async() => await executor.ProcessAsync(request), "On Cell Datum request. Failed to process coordinate conversion request.");
        }
Beispiel #2
0
        public void CompactionCellDatumExecutorNoResult()
        {
            var request =
                new CellDatumRequest(0, null, DisplayMode.CompactionCoverage, null, null, null, null, null);

            TCellProductionData data = new TCellProductionData();

            var raptorClient = new Mock <IASNodeClient>();
            var configStore  = new Mock <IConfigurationStore>();

            raptorClient.Setup(x => x.GetCellProductionData(
                                   request.ProjectId.Value,
                                   (int)RaptorConverters.convertDisplayMode(request.DisplayMode),
                                   request.GridPoint != null ? request.GridPoint.x : 0.0,
                                   request.GridPoint != null ? request.GridPoint.y : 0.0,
                                   It.IsAny <TWGS84Point>(),
                                   request.LLPoint == null,
                                   It.IsAny <TICFilterSettings>(),
                                   It.IsAny <TICLiftBuildSettings>(),
                                   It.IsAny <TVLPDDesignDescriptor>(),
                                   out data))
            .Returns(false);

            var executor = RequestExecutorContainerFactory
                           .Build <CompactionCellDatumExecutor>(logger, raptorClient.Object, configStore: configStore.Object);

            Assert.ThrowsExceptionAsync <ServiceException>(async() => await executor.ProcessAsync(request));
        }
Beispiel #3
0
 protected virtual CellDatumResult ConvertCellDatumResult(TCellProductionData result)
 {
     return(new CellDatumResult(
                RaptorConverters.convertDisplayMode((TICDisplayMode)result.DisplayMode),
                (CellDatumReturnCode)result.ReturnCode,
                result.ReturnCode == 0 ? result.Value : (double?)null,
                result.TimeStampUTC));
 }
Beispiel #4
0
 protected override CellDatumResult ConvertCellDatumResult(TCellProductionData result)
 {
     return(new CompactionCellDatumResult(
                RaptorConverters.convertDisplayMode((TICDisplayMode)result.DisplayMode),
                (CellDatumReturnCode)result.ReturnCode,
                result.ReturnCode == 0 ? result.Value : (double?)null,
                result.TimeStampUTC,
                _northing,
                _easting));
 }
Beispiel #5
0
        protected virtual bool GetCellDatumData(CellDatumRequest request, out TCellProductionData data)
        {
            var raptorFilter = RaptorConverters.ConvertFilter(request.Filter, request.ProjectId, raptorClient);

            return(raptorClient.GetCellProductionData
                       (request.ProjectId ?? VelociraptorConstants.NO_PROJECT_ID,
                       (int)RaptorConverters.convertDisplayMode(request.DisplayMode),
                       request.GridPoint?.x ?? 0,
                       request.GridPoint?.y ?? 0,
                       request.LLPoint != null ? RaptorConverters.ConvertWGSPoint(request.LLPoint) : new TWGS84Point(),
                       request.LLPoint == null,
                       raptorFilter,
                       RaptorConverters.ConvertLift(request.LiftBuildSettings, raptorFilter.LayerMethod),
                       RaptorConverters.DesignDescriptor(request.Design),
                       out data));
        }