Пример #1
0
        public void cancel_refund_should_fail_for_missing_deposit()
        {
            var         depositId = TestItem.KeccakA;
            Func <Task> act       = () => _consumerTransactionsService.CancelRefundAsync(depositId);

            act.Should().Throw <InvalidOperationException>()
            .WithMessage($"Deposit with id: '{depositId}' was not found.");
        }
        public async Task cancel_refund_should_fail_for_missing_deposit()
        {
            var depositId = TestItem.KeccakA;
            var info      = await _consumerTransactionsService.CancelRefundAsync(depositId);

            info.Status.Should().Be(UpdatedTransactionStatus.ResourceNotFound);
            info.Hash.Should().BeNull();
            await _depositRepository.Received().GetAsync(depositId);
        }
Пример #3
0
        public async Task cancel_refund_should_return_transaction_hash()
        {
            var depositId = TestItem.KeccakA;
            var canceledTransactionHash = TestItem.KeccakB;

            _consumerTransactionsService.CancelRefundAsync(depositId).Returns(canceledTransactionHash);
            var result = await _rpc.ndm_cancelRefund(depositId);

            result.Data.Should().Be(canceledTransactionHash);
            await _consumerTransactionsService.Received().CancelRefundAsync(depositId);
        }
Пример #4
0
        public async Task cancel_refund_should_return_transaction_hash()
        {
            var depositId = TestItem.KeccakA;
            var info      = new UpdatedTransactionInfo(UpdatedTransactionStatus.Ok, TestItem.KeccakB);

            _consumerTransactionsService.CancelRefundAsync(depositId).Returns(info);
            var result = await _rpc.ndm_cancelRefund(depositId);

            result.Data.Status.Should().Be(info.Status.ToString().ToLowerInvariant());
            result.Data.Hash.Should().Be(info.Hash);
            await _consumerTransactionsService.Received().CancelRefundAsync(depositId);
        }