use of com.thebluealliance.androidclient.listitems.ListItem in project the-blue-alliance-android by the-blue-alliance.
the class MyTbaModelRendererTest method testRenderDistrict.
@Test
public void testRenderDistrict() {
District district = ModelMaker.getModelList(District.class, "2015_districts").get(3);
district.setYear(2015);
when(mDatafeed.fetchDistrict(DISTRICT_KEY)).thenReturn(Observable.just(district));
ListItem item = mRenderer.renderFromKey(DISTRICT_KEY, ModelType.DISTRICT, null);
verify(mDistrictRenderer).renderFromKey(eq(DISTRICT_KEY), eq(ModelType.DISTRICT), anyObject());
}
use of com.thebluealliance.androidclient.listitems.ListItem 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.ListItem 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.ListItem 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.ListItem in project the-blue-alliance-android by the-blue-alliance.
the class AwardsListSubscriberTest method assertItemsEqual.
private void assertItemsEqual(int rawIndex, int sortedIndex) {
List<ListItem> data = DatafeedTestDriver.getParsedData(mSubscriber, mAwards);
CardedAwardListElement element = (CardedAwardListElement) data.get(sortedIndex);
Award award = mAwards.get(rawIndex);
assertEquals(element.mAwardName, award.getName());
assertEquals(element.mEventKey, award.getEventKey());
assertEquals(element.mSelectedTeamNum, "");
assertTrue(element.mAwardWinners.equals(award.getRecipientList()));
}
Aggregations