Ejemplo n.º 1
0
 @Test
 public final void testGetPosition() {
   double pos1[] = {2, 3.5, 4};
   assertTrue(Arrays.equals(pos1, log1.getPosition()));
   double pos2[] = {2.1, 3, 0};
   assertTrue(Arrays.equals(pos2, log2.getPosition()));
 }
Ejemplo n.º 2
0
 @Test
 public void testAdvanceTimeFalling() {
   double[] initialPos = log1.getPosition();
   log1.advanceTime(0.1);
   assertTrue(initialPos[2] > log1.getPosition()[2]);
   assertEquals(initialPos[0], log1.getPosition()[0], 0);
   assertEquals(initialPos[1], log1.getPosition()[1], 0);
 }
Ejemplo n.º 3
0
 public void testAdvancerTimeNotFalling() {
   double[] initialPos = log2.getPosition();
   log2.advanceTime(0.1);
   assertTrue(Arrays.equals(initialPos, log2.getPosition()));
 }
Ejemplo n.º 4
0
 @Test
 public void testGetWeight() {
   assertTrue(log2.getWeight() >= 10);
   assertTrue(log2.getWeight() <= 50);
 }
Ejemplo n.º 5
0
 @Test
 public void testGetCubePosition() {
   int[] cpos = {2, 3, 0};
   assertArrayEquals(cpos, log2.getCubePosition());
 }
Ejemplo n.º 6
0
 @Test(expected = IllegalArgumentException.class)
 public void testSetPositionIllegalCase() throws Exception {
   double[] newPos = {2, 6, 1};
   log3.setPosition(newPos);
 }
Ejemplo n.º 7
0
 @Test
 public final void testSetPositionLegalCase() {
   double[] newPos = {2, 2, 1};
   log1.setPosition(newPos);
   assertTrue(Arrays.equals(newPos, log1.getPosition()));
 }