Пример #1
1
 /** Test method for {@link icd3.Tank}. */
 @Test
 public void testTankBehavior() {
   Tank tank = new Tank();
   tank.setCoordinates(m_bottomLeft, m_topRight);
   assertTrue(tank.getBottom() == -4.5);
   assertTrue(tank.getTop() == 3.5);
   assertTrue(tank.baseArea() == 1.0);
 }
Пример #2
0
 /**
  * Test method for negative coordinate behavior of {@link icd3.Tank#setCoordinates(double[],
  * double[])}.
  */
 @Test(expected = IllegalArgumentException.class)
 public void testSetCoordinatesNegative() {
   Tank tank = new Tank();
   tank.setCoordinates(m_topRight, m_bottomLeft);
 }
Пример #3
0
 /**
  * Test method for not enough max dimensions behavior of {@link icd3.Tank#setCoordinates(double[],
  * double[])}.
  */
 @Test(expected = IllegalArgumentException.class)
 public void testSetCoordinatesWrongMaxDimension() {
   Tank tank = new Tank();
   tank.setCoordinates(new double[3], new double[2]);
 }
Пример #4
0
 /**
  * Test method for Illegal State behavior of {@link icd3.Tank#setCoordinates(double[], double[])}.
  */
 @Test(expected = IllegalStateException.class)
 public void testSetCoordinatesIllegalState() {
   Tank tank = new Tank();
   tank.setCoordinates(new double[3], new double[] {1, 1, 1});
   tank.setCoordinates(new double[3], new double[] {2, 2, 2});
 }