Пример #1
0
  public void testSetsAndGets() {
    Settings.getInstance().setAcc(TEST_VALUE);
    Settings.getInstance().setAntiAlias(true);
    Settings.getInstance().setBallAcceleration(TEST_VALUE);
    Settings.getInstance().setBalls(TEST_VALUE);
    Settings.getInstance().setBallStartSpeed(TEST_VALUE);
    Settings.getInstance().setLength(TEST_VALUE);
    Settings.getInstance().setLives(TEST_VALUE);
    Settings.getInstance().setMaxAmountOfBalls(TEST_VALUE);
    Settings.getInstance().setMaxBallSpeed(TEST_VALUE);
    Settings.getInstance().setScreenHeight(TEST_VALUE);
    Settings.getInstance().setScreenWidth(TEST_VALUE);
    Settings.getInstance().setSpeed(TEST_VALUE);
    Settings.getInstance().setTimeBetweenBallGeneration(TEST_VALUE);

    assertTrue(Settings.getInstance().getAcc() == TEST_VALUE);
    assertTrue(Settings.getInstance().isAntiAlias());
    assertTrue(Settings.getInstance().getBallAcceleration() == TEST_VALUE);
    assertTrue(Settings.getInstance().getBalls() == TEST_VALUE);
    assertTrue(Settings.getInstance().getBallStartSpeed() == TEST_VALUE);
    assertTrue(Settings.getInstance().getLength() == TEST_VALUE);
    assertTrue(Settings.getInstance().getLives() == TEST_VALUE);
    assertTrue(Settings.getInstance().getMaxAmountOfBalls() == TEST_VALUE);
    assertTrue(Settings.getInstance().getMaxBallSpeed() == TEST_VALUE);
    assertTrue(Settings.getInstance().getScreenHeight() == TEST_VALUE);
    assertTrue(Settings.getInstance().getScreenWidth() == TEST_VALUE);
    assertTrue(Settings.getInstance().getSpeed() == TEST_VALUE);
    assertTrue(Settings.getInstance().getTimeBetweenBallGeneration() == TEST_VALUE);
  }
Пример #2
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    activity = new ContextActivity();
    Settings.setApplicationContext(context);

    Settings.getInstance().setAcc(START_VALUE);
    Settings.getInstance().setAntiAlias(false);
    Settings.getInstance().setBallAcceleration(START_VALUE);
    Settings.getInstance().setBalls(START_VALUE);
    Settings.getInstance().setBallStartSpeed(START_VALUE);
    Settings.getInstance().setLength(START_VALUE);
    Settings.getInstance().setLives(START_VALUE);
    Settings.getInstance().setMaxAmountOfBalls(START_VALUE);
    Settings.getInstance().setMaxBallSpeed(START_VALUE);
    Settings.getInstance().setScreenHeight(START_VALUE);
    Settings.getInstance().setScreenWidth(START_VALUE);
    Settings.getInstance().setSpeed(START_VALUE);
    Settings.getInstance().setTimeBetweenBallGeneration(START_VALUE);
  }