Пример #1
0
  @Test
  public void testDieAndExist() throws Exception {
    BaseElement baseElement = createBaseElement();

    assertTrue(baseElement.isExist());

    baseElement.die();

    assertFalse(baseElement.isExist());
  }
Пример #2
0
  @Test
  public void testMove() throws Exception {
    BaseElement baseElement = createBaseElement();

    baseElement.setX(42);
    baseElement.setY(42);

    baseElement.setVx(1);
    baseElement.setVy(-1);

    baseElement.move();

    assertEquals(baseElement.getX(), 43);
    assertEquals(baseElement.getY(), 41);
  }
Пример #3
0
  @Test
  public void testIsInsideShouldNotBeInside() throws Exception {
    BaseElement baseElement = createBaseElement();

    baseElement.setX(42);
    baseElement.setY(42);

    baseElement.setHeight(1);
    baseElement.setWidth(1);

    BaseElement baseElementInside = createBaseElement();

    baseElementInside.setX(50);
    baseElementInside.setY(50);

    baseElementInside.setHeight(3);
    baseElementInside.setWidth(3);

    assertFalse(baseElementInside.isInside(baseElement));
  }