Exemplo n.º 1
0
        public async Task CreateEstimationAsync_Should_Save_The_Estimation()
        {
            // arrange
            _mockCountryService.IsSupportedCountryAsync("US", "IN", _cxlToken)
            .Returns(Task.FromResult(true));

            _mockPaymentService.TransactionRangeAsync("US")
            .Returns(Task.FromResult(new TransactionAmount {
                MinAmount = 500, MaxAmount = 1000
            }));

            //_mockTaxAndFeeService.GetFeeAsync("US", "IN", 600, _cxlToken)
            //    .Returns(Task.FromResult(new List<FeeDto>()));

            _mockExchangeService.GetExchangeRateAsync("US", "IN", _cxlToken)
            .Returns(1);

            // act
            var result = await _service.CreateEstimationAsync("US", "IN", 600, _cxlToken);

            await _mockEstimationRepository
            .Received(1)
            .SaveEstimationAsync(result.EstimationId, EstimationDto.ToString(result));
        }