Skip to content

Commit 37b1f98

Browse files
committed
modify test to reflect onDataCollected from onPayButtonClicked
1 parent 1275252 commit 37b1f98

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

raveandroid/src/test/java/com/flutterwave/raveandroid/ach/AchPresenterTest.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -388,17 +388,20 @@ public void verifyRequeryResponseStatus_transactionSuccessful_onPaymentSuccessfu
388388
}
389389

390390
@Test
391-
public void onPayButtonClicked_validAmount_showAmountError_onValidationSuccessfulCalled() {
392-
when(amountValidator.isAmountValid(ravePayInitializer.getAmount())).thenReturn(true);
393-
achPresenter.onPayButtonClicked(ravePayInitializer, anyString());
391+
public void onDataCollected_validAmount_showAmountError_onValidationSuccessfulCalledWithCorrectParams() {
392+
393+
String amount = generateRandomDouble().toString();
394+
395+
when(amountValidator.isAmountValid(amount)).thenReturn(true);
396+
achPresenter.onDataCollected(ravePayInitializer, amount);
394397
verify(view).showAmountError(null);
395-
verify(view).onValidationSuccessful(any(String.class));
398+
verify(view).onValidationSuccessful(amount);
396399
}
397400

398401
@Test
399-
public void onPayButtonClicked_inValidAmount_showAmountErrorWithCorrectParams() {
402+
public void onDataCollected_inValidAmount_showAmountErrorWithCorrectParams() {
400403
when(amountValidator.isAmountValid(ravePayInitializer.getAmount())).thenReturn(false);
401-
achPresenter.onPayButtonClicked(ravePayInitializer, anyString());
404+
achPresenter.onDataCollected(ravePayInitializer, anyString());
402405
verify(view).showAmountError(null);
403406
verify(view).showAmountError(RaveConstants.validAmountPrompt);
404407
}

0 commit comments

Comments
 (0)