use of com.thebluealliance.androidclient.listitems.CardedAwardListElement 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.CardedAwardListElement in project the-blue-alliance-android by the-blue-alliance.
the class AwardRendererTest method testRenderIndividualCarded.
@Test
public void testRenderIndividualCarded() {
Award award = ModelMaker.getModel(Award.class, AWARD_INDIVIDUAL);
ListItem rendered = mRenderer.renderFromModel(award, new AwardRenderer.RenderArgs(new HashMap<>(), null));
assertNotNull(rendered);
assertTrue(rendered instanceof CardedAwardListElement);
}
use of com.thebluealliance.androidclient.listitems.CardedAwardListElement 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()));
}
use of com.thebluealliance.androidclient.listitems.CardedAwardListElement 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.CardedAwardListElement in project the-blue-alliance-android by the-blue-alliance.
the class AwardRendererTest method testRenderTeamCarded.
@Test
public void testRenderTeamCarded() {
Award award = ModelMaker.getModel(Award.class, AWARD_TEAM);
ListItem rendered = mRenderer.renderFromModel(award, new AwardRenderer.RenderArgs(new HashMap<>(), null));
assertNotNull(rendered);
assertTrue(rendered instanceof CardedAwardListElement);
}
Aggregations