예제 #1
0
 @Test
 public void testSquareOrderVsNull() {
   Square mySquare = new Square(10);
   Shape nullShape = new NewShapeNull();
   assertTrue(mySquare.compareTo(null) == 1);
   assertTrue(mySquare.compareTo(nullShape) == 1);
 }
예제 #2
0
 @Test
 public void testSquareOrderingVsObject() {
   Square mySquare = new Square(10);
   Shape last = new NewShapeOther();
   assertTrue(mySquare.compareTo(last) < 0);
 }
예제 #3
0
 @Test
 public void testSquareOrderVsSquare() {
   Square mySquare = new Square(10);
   Square mySquare1 = new Square(189);
   assertTrue(mySquare.compareTo(mySquare1) == 0);
 }
예제 #4
0
 @Test
 public void testSquareOrderVsCircle() {
   Square mySquare = new Square(10);
   Circle myCircle = new Circle(10);
   assertTrue(mySquare.compareTo(myCircle) > 0);
 }