예제 #1
0
        public async Task <ActionResult <EstimationResponse> > Post(EstimationRequest request, CancellationToken cxlToken)
        {
            var estimation = await _estimationService
                             .CreateEstimationAsync(
                request.From,
                request.To,
                request.TransferAmount,
                cxlToken);

            EstimationResponse result = estimation;

            return(Created(new Uri($"/estimation/{estimation.EstimationId}", UriKind.Relative), (EstimationResponse)estimation));
        }
예제 #2
0
        public void CreateEstimationAsync_Should_Throw_Exception_When_Invalid_From_Country()
        {
            // arrange
            _mockCountryService.IsSupportedCountryAsync("", "IN", _cxlToken)
            .Returns(Task.FromResult(false));

            // assert
            Assert.ThrowsAsync <ArgumentException>(async() => await _service.CreateEstimationAsync("", "IN", 1000, _cxlToken));
        }