Exemplo n.º 1
0
        private async Task TipTransferableShouldReturnNotEnoughNxtFunds(NxtTransferable transferable, string recipient, int recipientCount = 1, decimal nxtBalance = 0.9M)
        {
            transferables.AddTransferable(transferable);
            SetupNxtAccount(TestConstants.SenderAccount, nxtBalance);
            var message = CreateChannelMessage($"tipper tip {recipient} 42 {transferable.Name}");

            await slackHandler.TipBotChannelCommand(message, slackUser, channelSession);

            slackConnectorMock.Verify(c => c.SendMessage(channelSession.Id,
                                                         It.Is <string>(input => input.Equals(MessageConstants.NotEnoughFundsNeedFee(nxtBalance, recipientCount))), true));
        }
Exemplo n.º 2
0
        private async Task WithdrawTransferableShouldReturnNotEnoughNxtFunds(NxtTransferable transferable)
        {
            const decimal balance = 0.9M;

            transferables.AddTransferable(transferable);
            SetupNxtAccount(TestConstants.SenderAccount, balance);

            await slackHandler.InstantMessageCommand($"withdraw {TestConstants.RecipientAccount.NxtAccountRs} 42 {transferable.Name}", slackUser, imSession);

            slackConnectorMock.Verify(c => c.SendMessage(imSession.Id,
                                                         It.Is <string>(input => input.Equals(MessageConstants.NotEnoughFundsNeedFee(balance, 1))), true));
        }
Exemplo n.º 3
0
        public async void TipNxtShouldReturnYouNeedNxtForFee(string amount)
        {
            const decimal balance = 4;

            SetupNxtAccount(TestConstants.SenderAccount, balance);
            var message = CreateChannelMessage($"tipper tip <@{TestConstants.RecipientAccount.SlackId}> {amount}");

            await slackHandler.TipBotChannelCommand(message, slackUser, channelSession);

            slackConnectorMock.Verify(c => c.SendMessage(channelSession.Id,
                                                         It.Is <string>(input => input.Equals(MessageConstants.NotEnoughFundsNeedFee(balance, 1))), true));
        }
Exemplo n.º 4
0
        public async void WithdrawNxtShouldReturnYouNeedNxtForFee(string amount)
        {
            const decimal balance = 4;

            SetupNxtAccount(TestConstants.SenderAccount, balance);

            await slackHandler.InstantMessageCommand($"withdraw {TestConstants.RecipientAccount.NxtAccountRs} {amount}", slackUser, imSession);

            slackConnectorMock.Verify(c => c.SendMessage(imSession.Id,
                                                         It.Is <string>(input => input.Equals(MessageConstants.NotEnoughFundsNeedFee(balance, 1))), true));
        }