Package purrpackagedemo.round

Source Code of purrpackagedemo.round.CircleTest

package purrpackagedemo.round;

import junit.framework.Assert;

import org.junit.Test;

import purrpackagedemo.Point;

public class CircleTest extends Assert {

  // @Test
  public void whatShouldBeATestForContains() {
    assertTrue(Circle.UNIT.contains(Point.ORIGIN));
    // Circle c = new Circle(new Point(1, 1), 2);
    // assertTrue(c.contains(new Point(2.95, 1)));
    // assertTrue(c.contains(new Point(0, 0)));
    // assertTrue(c.contains(new Point(1, 1)));
    // assertFalse(c.contains(new Point(-.95, -.95)));
  }

  @Test
  public void testArgumentCheckinUsingJUnitThreeConvention() {
    try {
      Circle c = new Circle(new Point(1, 1), -1);
      fail(c.toString());
    } catch (IllegalArgumentException e) {
    }
    try {
      Circle c = new Circle(null, 0);
      fail(c.toString());
    } catch (IllegalArgumentException e) {
    }
    new Circle(Point.ORIGIN, 0);
  }

}
TOP

Related Classes of purrpackagedemo.round.CircleTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.