Esempio n. 1
0
        private async Task TipTransferableShouldReturnNotEnoughTransferableFunds(NxtTransferable transferable, string recipient, decimal balance = 1M)
        {
            const decimal nxtBalance = 100M;

            SetupNxtAccount(TestConstants.SenderAccount, nxtBalance);
            SetupTransferable(transferable, balance, TestConstants.SenderAccount.NxtAccountRs);
            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.NotEnoughFunds(balance, transferable.Name))), true));
        }
Esempio n. 2
0
        private async Task WithdrawTransferableShouldReturnNotEnoughCurrencyFunds(NxtTransferable transferable)
        {
            const decimal nxtBalance = 1M;
            const decimal balance    = 1M;

            SetupNxtAccount(TestConstants.SenderAccount, nxtBalance);
            SetupTransferable(transferable, balance, TestConstants.SenderAccount.NxtAccountRs);

            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.NotEnoughFunds(balance, transferable.Name))), true));
        }
Esempio n. 3
0
        public async void TipNxtShouldReturnNotEnoughFundsOnMultipleRecipients()
        {
            const decimal tipAmount = 42;
            const decimal balance   = 50;
            var           message   = CreateChannelMessage($"<@{botUserId}> tip <@{TestConstants.RecipientAccount.SlackId}>, <@{TestConstants.RecipientAccount2.SlackId}> {tipAmount}");

            SetupNxtAccount(TestConstants.SenderAccount, balance);

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

            slackConnectorMock.Verify(c => c.SendMessage(channelSession.Id,
                                                         It.Is <string>(input => input.Equals(MessageConstants.NotEnoughFunds(balance, "NXT"))), true));
        }
Esempio n. 4
0
        public async void WithdrawNxtShouldReturnNotEnoughFunds()
        {
            const decimal balance = 4;

            SetupNxtAccount(TestConstants.SenderAccount, balance);

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

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