@Test public void checkTransferAmount(){ String transferAmount = ""; presenter.checkTransferAmount(transferAmount); Mockito.verify(view).showAmountError(Mockito.any()); }
@Override public boolean checkTransferAmount(String transferAmount) { String errMsg = null; if (TextUtils.isEmpty(transferAmount)) { errMsg = string(R.string.transfer_amount_cannot_be_empty); } else { if (!isBalanceEnough(transferAmount)) { errMsg = string(R.string.insufficient_balance); } } getView().showAmountError(errMsg); return TextUtils.isEmpty(errMsg); }
SendTransactionPresenter extends BasePresenter<SendTransationContract.View> implements SendTransationContract.Presenter { @Override public boolean checkTransferAmount(String transferAmount) { String errMsg = null; if (TextUtils.isEmpty(transferAmount)) { errMsg = string(R.string.transfer_amount_cannot_be_empty); } else { if (!isBalanceEnough(transferAmount)) { errMsg = string(R.string.insufficient_balance); } } getView().showAmountError(errMsg); return TextUtils.isEmpty(errMsg); } }
SendTransactionPresenter extends BasePresenter<SendTransationContract.View> implements SendTransationContract.Presenter { @Override public boolean checkTransferAmount(String transferAmount) { String errMsg = null; if (TextUtils.isEmpty(transferAmount)) { errMsg = string(R.string.transfer_amount_cannot_be_empty); } else { if (!isBalanceEnough(transferAmount)) { errMsg = string(R.string.insufficient_balance); } } getView().showAmountError(errMsg); return TextUtils.isEmpty(errMsg); }  }
SendTransactionPresenter extends BasePresenter<SendTransationContract.View> implements SendTransationContract.Presenter { @Override public boolean checkTransferAmount(String transferAmount) { String errMsg = null; if (TextUtils.isEmpty(transferAmount)) { errMsg = string(R.string.transfer_amount_cannot_be_empty); } else { if (!isBalanceEnough(transferAmount)) { errMsg = string(R.string.insufficient_balance); } } getView().showAmountError(errMsg); return TextUtils.isEmpty(errMsg); }  @Override void init(); String getSenderAddress(); @Override void fetchDefaultWalletInfo(); void getEstimateGas(Wallet mWallet); @Override void transferAllBalance(); @Override void calculateFee(); @Override void calculateFeeAndTime(float progress); @Override boolean checkToAddress(String toAddress); boolean checkToAddressNotSelf(String toAddress,String address); @Override boolean checkTransferAmount(String transferAmount); void checkTransferAmountDueToGasLimitChanged(String transferAmount); @Override void submit(); @Override void updateSendTransactionButtonStatus(); @Override void saveWallet(String name, String address); @Override void updateAssetsTab(int tabIndex); @Override void setGasLimit(String gasLimit); @Override void checkAddressBook(String address); }
SendTransactionPresenter extends BasePresenter<SendTransationContract.View> implements SendTransationContract.Presenter { @Override public boolean checkTransferAmount(String transferAmount) { String errMsg = null; if (TextUtils.isEmpty(transferAmount)) { errMsg = string(R.string.transfer_amount_cannot_be_empty); } else { if (!isBalanceEnough(transferAmount)) { errMsg = string(R.string.insufficient_balance); } } getView().showAmountError(errMsg); return TextUtils.isEmpty(errMsg); }  @Override void init(); String getSenderAddress(); @Override void fetchDefaultWalletInfo(); void getEstimateGas(Wallet mWallet); @Override void transferAllBalance(); @Override void calculateFee(); @Override void calculateFeeAndTime(float progress); @Override boolean checkToAddress(String toAddress); boolean checkToAddressNotSelf(String toAddress,String address); @Override boolean checkTransferAmount(String transferAmount); void checkTransferAmountDueToGasLimitChanged(String transferAmount); @Override void submit(); @Override void updateSendTransactionButtonStatus(); @Override void saveWallet(String name, String address); @Override void updateAssetsTab(int tabIndex); @Override void setGasLimit(String gasLimit); @Override void checkAddressBook(String address);  }