Esempio n. 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();
        }
Esempio n. 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)));
        }
Esempio n. 3
0
        public void CellPassesRequest_ValidateMissingPoint()
        {
            var req = new CellPassesTRexRequest(Guid.NewGuid(), (Point)null, null, null, null);

            Assert.Throws <ServiceException>(() => req.Validate());
        }
Esempio n. 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());
        }