MethodCard extends CompactComponent<MethodCard.Props, Void> { @VisibleForTesting boolean shouldShowSubtitle() { return TextUtil.isNotEmpty(props.bankName) && !props.bankName.equals(props.cardName); } MethodCard(final Props props); @Override View render(@NonNull final ViewGroup parent);  }
@Test public void when_issuer_name_equals_card_name_then_should_show_is_false() throws Exception { MethodCard.Props props = new MethodCard.Props("1234", "visa", "1235", "visa"); MethodCard methodCard = new MethodCard(props); assertFalse(methodCard.shouldShowSubtitle()); }
@Test public void when_issuer_is_empty_then_should_show_is_false() throws Exception { MethodCard.Props props = new MethodCard.Props("1234", "visa", "1235", ""); MethodCard methodCard = new MethodCard(props); assertFalse(methodCard.shouldShowSubtitle()); }
@Test public void when_issuer_different_than_card_name_then_should_show_is_true() throws Exception { MethodCard.Props props = new MethodCard.Props("1234", "visa", "1235", "banco visa"); MethodCard methodCard = new MethodCard(props); assertTrue(methodCard.shouldShowSubtitle()); }