Ejemplo n.º 1
0
  /** Test method for {@link fr.squallco.score.model.Soccer#isShootOutMode()}. */
  @Test
  public void testShootOutMode() {
    // Activate
    mSoccerModel.setShootOutMode(true);
    assertTrue(mSoccerModel.isShootOutMode());

    // Deactivate
    mSoccerModel.setShootOutMode(false);
    assertFalse(mSoccerModel.isShootOutMode());

    // No activation if scores aren't equal
    mSoccerModel.setHomeScorePlus1();
    mSoccerModel.setShootOutMode(true);
    assertFalse(mSoccerModel.isShootOutMode());

    // Activation if scores are equal
    mSoccerModel.setVisitorScorePlus1();
    mSoccerModel.setShootOutMode(true);
    assertTrue(mSoccerModel.isShootOutMode());
  }
Ejemplo n.º 2
0
  /** Test method for {@link fr.squallco.score.model.Soccer#resetScore()}. */
  @Test
  public void testResetScore() {
    mSoccerModel.setHomeScorePlus1();
    mSoccerModel.setVisitorScorePlus1();
    mSoccerModel.setShootOutMode(true);
    mSoccerModel.setHomeScorePlus1();
    mSoccerModel.setVisitorScorePlus1();

    mSoccerModel.resetScore();

    assertEquals(0, mSoccerModel.getHomeScore());
    assertEquals(0, mSoccerModel.getVisitorScore());
    assertEquals(0, mSoccerModel.getHomeShootOutScore());
    assertEquals(0, mSoccerModel.getVisitorShootOutScore());
    assertFalse(mSoccerModel.isShootOutMode());
  }