public async Task given_unpaid_value_lower_than_merge_receipts_policy_it_should_not_be_possible_to_merge_receipts() { _providerThresholdsService.GetCurrentReceiptsMergeAsync().Returns(_receiptsMergeThreshold); _consumerUnpaidUnits = 999; var policies = CreatePolicies(); var result = await policies.CanMergeReceipts(_consumerUnpaidUnits, _unitPrice); result.Should().BeFalse(); }
public async Task get_current_should_return_chosen_receipts_merge_threshold() { await _providerThresholdsService.SetReceiptsMergeAsync(8000000000000000); var receiptsMergeThreshold = await _providerThresholdsService.GetCurrentReceiptsMergeAsync(); receiptsMergeThreshold.Should().Be(_config.ReceiptsMergeThreshold); await _configManager.Received().GetAsync(ConfigId); }
public async Task <bool> CanMergeReceipts(long unmergedUnits, UInt256 unitPrice) => (UInt256)unmergedUnits * unitPrice >= await _providerThresholdsService.GetCurrentReceiptsMergeAsync();