use of com.thebluealliance.androidclient.listitems.ModelListElement in project the-blue-alliance-android by the-blue-alliance.
the class MyTbaModelRendererTest method testRenderEventTeam.
@Test
public void testRenderEventTeam() {
Team team = ModelMaker.getModel(Team.class, TEAM_KEY);
Event event = ModelMaker.getModel(Event.class, EVENT_KEY);
when(mDatafeed.fetchTeam(TEAM_KEY)).thenReturn(Observable.just(team));
when(mDatafeed.fetchEvent(EVENT_KEY)).thenReturn(Observable.just(event));
ListItem item = mRenderer.renderFromKey(EVENT_TEAM_KEY, ModelType.EVENTTEAM, null);
assertNotNull(item);
assertTrue(item instanceof ModelListElement);
assertEquals(((ModelListElement) item).getText(), "UberBots @ 2015 Hartford");
assertEquals(((ModelListElement) item).getKey(), EVENT_TEAM_KEY);
assertEquals(((ModelListElement) item).getType(), ModelType.EVENTTEAM);
}
use of com.thebluealliance.androidclient.listitems.ModelListElement in project the-blue-alliance-android by the-blue-alliance.
the class MyTbaModelRendererTest method testNullMatch.
@Test
public void testNullMatch() {
when(mDatafeed.fetchMatch(MATCH_KEY)).thenReturn(Observable.just(null));
ListItem item = mRenderer.renderFromKey(MATCH_KEY, ModelType.MATCH, null);
assertNotNull(item);
assertTrue(item instanceof ModelListElement);
assertEquals(((ModelListElement) item).getText(), "2014cmp_f1m1");
assertEquals(((ModelListElement) item).getKey(), MATCH_KEY);
assertEquals(((ModelListElement) item).getType(), ModelType.MATCH);
}
use of com.thebluealliance.androidclient.listitems.ModelListElement in project the-blue-alliance-android by the-blue-alliance.
the class MyTbaModelRendererTest method testNullEventTeam.
@Test
public void testNullEventTeam() {
when(mDatafeed.fetchTeam(TEAM_KEY)).thenReturn(Observable.just(null));
when(mDatafeed.fetchEvent(EVENT_KEY)).thenReturn(Observable.just(null));
ListItem item = mRenderer.renderFromKey(EVENT_TEAM_KEY, ModelType.EVENTTEAM, null);
assertNotNull(item);
assertTrue(item instanceof ModelListElement);
assertEquals(((ModelListElement) item).getText(), "frc1124 @ 2015cthar");
assertEquals(((ModelListElement) item).getKey(), EVENT_TEAM_KEY);
assertEquals(((ModelListElement) item).getType(), ModelType.EVENTTEAM);
}
use of com.thebluealliance.androidclient.listitems.ModelListElement in project the-blue-alliance-android by the-blue-alliance.
the class MyTbaModelRendererTest method testNullDistrict.
@Test
public void testNullDistrict() {
when(mDatafeed.fetchDistrict(DISTRICT_KEY)).thenReturn(Observable.just(null));
ListItem item = mRenderer.renderFromKey(DISTRICT_KEY, ModelType.DISTRICT, null);
assertNotNull(item);
assertTrue(item instanceof ModelListElement);
assertEquals(((ModelListElement) item).getText(), DISTRICT_KEY);
assertEquals(((ModelListElement) item).getKey(), DISTRICT_KEY);
assertEquals(((ModelListElement) item).getType(), ModelType.DISTRICT);
}
use of com.thebluealliance.androidclient.listitems.ModelListElement in project the-blue-alliance-android by the-blue-alliance.
the class MyTbaModelRendererTest method testNullTeam.
@Test
public void testNullTeam() {
when(mDatafeed.fetchTeam(TEAM_KEY)).thenReturn(Observable.just(null));
ListItem item = mRenderer.renderFromKey(TEAM_KEY, ModelType.TEAM, null);
assertNotNull(item);
assertTrue(item instanceof ModelListElement);
assertEquals(((ModelListElement) item).getText(), "frc1124");
assertEquals(((ModelListElement) item).getKey(), TEAM_KEY);
assertEquals(((ModelListElement) item).getType(), ModelType.TEAM);
}
Aggregations