public async Task given_unpaid_value_lower_than_claim_payment_policy_it_should_not_be_possible_to_send_claim() { _providerThresholdsService.GetCurrentPaymentClaimAsync().Returns(_paymentClaimThreshold); _consumerUnpaidUnits = 9990; var policies = CreatePolicies(); var result = await policies.CanClaimPayment(_consumerUnpaidUnits, _unitPrice); result.Should().BeFalse(); }
public async Task get_current_should_return_chosen_payment_claim_threshold() { await _providerThresholdsService.SetPaymentClaimAsync(7000000000000000); var paymentClaimThreshold = await _providerThresholdsService.GetCurrentPaymentClaimAsync(); paymentClaimThreshold.Should().Be(_config.PaymentClaimThreshold); await _configManager.Received().GetAsync(ConfigId); }
public async Task <bool> CanClaimPayment(long unclaimedUnits, UInt256 unitPrice) => (UInt256)unclaimedUnits * unitPrice >= await _providerThresholdsService.GetCurrentPaymentClaimAsync();