Search in sources :

Example 1 with IMatchAlliance

use of com.thebluealliance.api.model.IMatchAlliance in project the-blue-alliance-android by the-blue-alliance.

the class MatchTest method testMatchModel.

@Test
public void testMatchModel() {
    assertNotNull(mMatch);
    assertEquals(mMatch.getKey(), "2014cmp_f1m1");
    assertEquals(mMatch.getMatchNumber().intValue(), 1);
    assertEquals(mMatch.getSetNumber().intValue(), 1);
    assertEquals(mMatch.getEventKey(), "2014cmp");
    assertNotNull(mMatch.getTime());
    assertEquals(mMatch.getTime().intValue(), 1398551880);
    assertNotNull(mMatch.getVideos());
    assertNotNull(mMatch.getAlliances());
    List<IMatchVideo> videos = mMatch.getVideos();
    assertEquals(videos.size(), 2);
    IMatchVideo video1 = videos.get(0);
    assertEquals(video1.getType(), "youtube");
    assertEquals(video1.getKey(), "jdJutaggCMk");
    IMatchAlliancesContainer alliances = mMatch.getAlliances();
    IMatchAlliance blueAlliance = alliances.getBlue();
    assertEquals(blueAlliance.getScore().intValue(), 361);
    List<String> blueTeams = blueAlliance.getTeamKeys();
    assertEquals(blueTeams.size(), 3);
    assertEquals(blueTeams.get(0), "frc469");
}
Also used : IMatchAlliancesContainer(com.thebluealliance.api.model.IMatchAlliancesContainer) IMatchAlliance(com.thebluealliance.api.model.IMatchAlliance) IMatchVideo(com.thebluealliance.api.model.IMatchVideo) Test(org.junit.Test)

Aggregations

IMatchAlliance (com.thebluealliance.api.model.IMatchAlliance)1 IMatchAlliancesContainer (com.thebluealliance.api.model.IMatchAlliancesContainer)1 IMatchVideo (com.thebluealliance.api.model.IMatchVideo)1 Test (org.junit.Test)1