use of com.karumi.rosie.sample.characters.domain.model.Character in project Rosie by Karumi.
the class CharacterDetailsActivityTest method shouldShowCharacterDetailWhenCharacterIsLoaded.
@Test
public void shouldShowCharacterDetailWhenCharacterIsLoaded() throws Exception {
Character character = givenAValidCharacter();
startActivity();
onView(withId(R.id.tv_character_name)).check(matches(withText(character.getName())));
onView(withId(R.id.tv_description)).check(matches(withText(character.getDescription())));
}
use of com.karumi.rosie.sample.characters.domain.model.Character in project Rosie by Karumi.
the class CharacterDetailsActivityTest method getCharacter.
@NonNull
private Character getCharacter(int id) {
Character character = new Character();
character.setKey("" + id);
character.setName("SuperHero - " + id);
character.setDescription("Description Super Hero - " + id);
character.setThumbnailUrl("https://id.annihil.us/u/prod/marvel/id/mg/c/60/55b6a28ef24fa.jpg");
return character;
}
use of com.karumi.rosie.sample.characters.domain.model.Character in project Rosie by Karumi.
the class MainActivityTest method shouldOpenCharacterDetailActivityOnRecyclerViewItemClicked.
@Test
public void shouldOpenCharacterDetailActivityOnRecyclerViewItemClicked() throws Exception {
List<Character> characters = givenThereAreSomeCharacters(ANY_NUMBER_OF_CHARACTERS);
int characterIndex = 0;
startActivity();
onView(withId(R.id.rv_characters)).perform(RecyclerViewActions.actionOnItemAtPosition(characterIndex, click()));
Character characterSelected = characters.get(characterIndex);
intended(hasComponent(CharacterDetailsActivity.class.getCanonicalName()));
intended(hasExtra("CharacterDetailsActivity.CharacterKey", characterSelected.getKey()));
}
Aggregations