Пример #1
0
        public async Task given_unpaid_value_lower_than_receipt_request_policy_it_should_not_be_possible_to_send_receipt()
        {
            _providerThresholdsService.GetCurrentReceiptRequestAsync().Returns(_receiptRequestThreshold);
            _sessionUnpaidUnits = 99;
            var policies = CreatePolicies();
            var result   = await policies.CanRequestReceipts(_sessionUnpaidUnits, _unitPrice);

            result.Should().BeFalse();
        }
Пример #2
0
        public async Task get_current_should_return_chosen_receipt_request_threshold()
        {
            await _providerThresholdsService.SetReceiptRequestAsync(9000000000000000);

            var receiptRequestThreshold = await _providerThresholdsService.GetCurrentReceiptRequestAsync();

            receiptRequestThreshold.Should().Be(_config.ReceiptRequestThreshold);
            await _configManager.Received().GetAsync(ConfigId);
        }
Пример #3
0
 public async Task <bool> CanRequestReceipts(long unpaidUnits, UInt256 unitPrice)
 => (UInt256)unpaidUnits * unitPrice >= await _providerThresholdsService.GetCurrentReceiptRequestAsync();