use of com.thebluealliance.androidclient.listitems.ListItem in project the-blue-alliance-android by the-blue-alliance.
the class AwardsListSubscriberTest method testParse.
@Test
public void testParse() {
List<ListItem> data = DatafeedTestDriver.getParsedData(mSubscriber, mAwards);
assertEquals(data.size(), 21);
for (int i = 0; i < data.size(); i++) {
assertTrue(data.get(i) instanceof CardedAwardListElement);
}
// Test EventBus posting
assertTrue(mSubscriber.shouldPostToEventBus());
EventBus eventBus = mock(EventBus.class);
mSubscriber.postToEventBus(eventBus);
verify(eventBus).post(any(EventAwardsEvent.class));
}
use of com.thebluealliance.androidclient.listitems.ListItem in project the-blue-alliance-android by the-blue-alliance.
the class ContributorListSubscriberTest method testParsedData.
@Test
public void testParsedData() {
List<ListItem> parsed = DatafeedTestDriver.getParsedData(mSubscriber, mData);
assertEquals(1, parsed.size());
assertTrue(parsed.get(0) instanceof ContributorListElement);
ContributorListElement element = (ContributorListElement) parsed.get(0);
assertEquals("phil-lopreiato", element.username);
assertEquals(1266, element.contributionCount);
assertEquals("https://avatars.githubusercontent.com/u/2754863?v=3", element.avatarUrl);
}
use of com.thebluealliance.androidclient.listitems.ListItem in project the-blue-alliance-android by the-blue-alliance.
the class DistrictPointsListSubscriberTest method testParseInvalidJson.
@Test
public void testParseInvalidJson() {
List<ListItem> data = DatafeedTestDriver.getParsedData(mSubscriber, new JsonObject());
assertNotNull(data);
assertEquals(data.size(), 0);
}
use of com.thebluealliance.androidclient.listitems.ListItem in project the-blue-alliance-android by the-blue-alliance.
the class DistrictPointsListSubscriberTest method testParseNonDistrict.
@Test
public void testParseNonDistrict() {
List<ListItem> data = DatafeedTestDriver.getParsedData(mSubscriber, mPoints);
DistrictTeamListElement element = new DistrictTeamListElement("frc1124", "", "Team 1124", 1, 87);
assertNotNull(data);
assertEquals(data.size(), 1);
assertTrue(element.equals(data.get(0)));
}
use of com.thebluealliance.androidclient.listitems.ListItem in project the-blue-alliance-android by the-blue-alliance.
the class DistrictRankingsSubscriberTest method testParse.
@Test
public void testParse() {
List<ListItem> data = DatafeedTestDriver.getParsedData(mSubscriber, mDistrictTeams);
DistrictTeamListElement element = new DistrictTeamListElement("frc1124", "2015ne", "Team 1124", 26, 157);
assertNotNull(data);
assertEquals(data.size(), 179);
assertTrue(data.get(25).equals(element));
}
Aggregations