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)); }
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)); }
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)); }
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)); }