Beispiel #1
0
        public void CellPassesRequest_ValidateSuccess()
        {
            var req = new CellPassesTRexRequest(Guid.NewGuid(), new Point(123.456, 987.654), null, null, null);

            req.Validate();

            var req2 = new CellPassesTRexRequest(Guid.NewGuid(), new WGSPoint(0.01, 0.01), null, null, null);

            req2.Validate();
        }
Beispiel #2
0
        public Task <ContractExecutionResult> PostCellPasses([FromBody] CellPassesTRexRequest cellPassesRequest)
        {
            Log.LogInformation($"{nameof(PostCellPasses)}: {JsonConvert.SerializeObject(cellPassesRequest)}");

            cellPassesRequest.Validate();

            return(WithServiceExceptionTryExecuteAsync(() =>
                                                       RequestExecutorContainer
                                                       .Build <CellPassesExecutor>(ConfigStore, LoggerFactory, ServiceExceptionHandler)
                                                       .ProcessAsync(cellPassesRequest)));
        }
Beispiel #3
0
        public void CellPassesRequest_ValidateMissingPoint()
        {
            var req = new CellPassesTRexRequest(Guid.NewGuid(), (Point)null, null, null, null);

            Assert.Throws <ServiceException>(() => req.Validate());
        }
Beispiel #4
0
        public void CellPassesRequest_ValidateMissingProjectUid()
        {
            var req = new CellPassesTRexRequest(Guid.Empty, new Point(123.456, 987.654), null, null, null);

            Assert.Throws <ServiceException>(() => req.Validate());
        }