TranslationCardItem extends LinearLayout { public Translation getTranslation(){ return translation; } TranslationCardItem(Context context);  TranslationCardItem(Context context, AttributeSet attrs);  TranslationCardItem(Context context, AttributeSet attrs, int defStyleAttr); void setTranslation(Translation translation, String language); void setTranslation(Translation translation, String language, int index); void setEditClickListener(OnClickListener listener); void setDeleteClickListener(OnClickListener listener); void setCardExpanded(boolean cardExpanded); void setShowDeleteAndEditOptions(boolean showDeleteAndEditOptions); void setGreyOutIfNoAudio(boolean greyOutIfNoAudio); Translation getTranslation(); static final int DISABLED_OPACITY; static final int DEFAULT_OPACITY; }
@Test public void shouldStopPlayingWhenPlayButtonIsClickedTwiceOnSameCard() throws AudioFileNotSetException { TranslationCardItem translationCardItem = getDefaultTranslationCard(); when(decoratedMediaManager.isCurrentlyPlayingSameCard(translationCardItem.getTranslation().getFilePath())) .thenReturn(false).thenReturn(true); createTranslationCardItemWithAudioAndNoTranslatedText(); translationCardItem.findViewById(R.id.translation_card).performClick(); translationCardItem.findViewById(R.id.translation_card).performClick(); verify(decoratedMediaManager).stop(); }