use of com.thebluealliance.androidclient.listitems.ListItem in project the-blue-alliance-android by the-blue-alliance.
the class TeamListSubscriber method parseData.
@Override
public void parseData() {
mDataToBind.clear();
Collections.sort(mAPIData, mComparator);
for (int i = 0; i < mAPIData.size(); i++) {
Team team = mAPIData.get(i);
if (team == null) {
continue;
}
ListItem item = mRenderer.renderFromModel(team, mRenderMode);
if (item == null) {
continue;
}
mDataToBind.add(item);
}
}
use of com.thebluealliance.androidclient.listitems.ListItem in project the-blue-alliance-android by the-blue-alliance.
the class StatsListSubscriberTest method testParsedData.
@Test
public void testParsedData() {
StatsListSubscriber.Model model = new StatsListSubscriber.Model(mStats, mInsights);
List<ListItem> data = DatafeedTestDriver.getParsedData(mSubscriber, model);
assertEquals(66, data.size());
assertTrue(data.get(0) instanceof StatsListElement);
StatsListElement actual = ((StatsListElement) data.get(0));
assertEquals(actual.teamNumber, "3419");
assertEquals(actual.teamName, "Team 3419");
assertEquals(actual.opr, 41.76934455450079, 0);
assertEquals(actual.dpr, 18.164742518609433, 0);
assertEquals(actual.ccwm, 23.60460203589137, 0);
}
use of com.thebluealliance.androidclient.listitems.ListItem in project the-blue-alliance-android by the-blue-alliance.
the class TeamAtDistrictSummarySubscriberTest method testParsedData.
@Test
public void testParsedData() {
List<ListItem> data = DatafeedTestDriver.getParsedData(mSubscriber, mDistrictTeam);
assertEquals(5, data.size());
LabelValueListItem rank = getItemAtPosition(0, data);
LabelValueDetailListItem event1 = getDetailItemAtPoistion(1, data);
LabelValueDetailListItem event2 = getDetailItemAtPoistion(2, data);
LabelValueDetailListItem cmp = getDetailItemAtPoistion(3, data);
LabelValueListItem total = getItemAtPosition(4, data);
String event1Key = EventTeamHelper.generateKey("2015nhnas", "frc1519");
String event2Key = EventTeamHelper.generateKey("2015manda", "frc1519");
String cmpKey = EventTeamHelper.generateKey("2015necmp", "frc1519");
assertEquals(new LabelValueListItem("District Rank", "1st"), rank);
assertEquals(new LabelValueDetailListItem("2015nhnas", "73 Points", event1Key), event1);
assertEquals(new LabelValueDetailListItem("2015manda", "73 Points", event2Key), event2);
assertEquals(new LabelValueDetailListItem("2015necmp", "219 Points", cmpKey), cmp);
assertEquals(new LabelValueListItem("Total Points", "365 Points"), total);
}
use of com.thebluealliance.androidclient.listitems.ListItem in project the-blue-alliance-android by the-blue-alliance.
the class AwardsListSubscriberTest method testSelectedTeam.
@Test
public void testSelectedTeam() {
mSubscriber.setTeamKey("frc195");
List<ListItem> data = DatafeedTestDriver.getParsedData(mSubscriber, mAwards);
CardedAwardListElement element = (CardedAwardListElement) data.get(0);
assertEquals(element.mSelectedTeamNum, "195");
}
use of com.thebluealliance.androidclient.listitems.ListItem in project the-blue-alliance-android by the-blue-alliance.
the class MatchInfoSubscriberTest method testParsedData.
@Test
public void testParsedData() {
List<ListItem> data = DatafeedTestDriver.getParsedData(mSubscriber, mData);
assertEquals(3, data.size());
assertTrue(data.get(0) instanceof MatchListElement);
assertTrue(data.get(1) instanceof ImageListElement);
Media videoItem = ((Match.MatchVideo) mData.match.getVideos().get(0)).asMedia();
ImageListElement video = (ImageListElement) data.get(1);
verify(mRenderer).renderFromModel(mData.match, MatchRenderer.RENDER_MATCH_INFO);
assertTrue(video.equals(mMediaRenderer.renderFromModel(videoItem, null)));
}
Aggregations