package purrpackagedemo.aggregate;
import junit.framework.TestCase;
import org.junit.Test;
import purrpackagedemo.Point;
import purrpackagedemo.Region;
import purrpackagedemo.round.Circle;
public class TestComplement extends TestCase {
@Test
public void testContains() {
Region s1 = Region.UPPER_HALF_PLANE;
Region s2 = Circle.UNIT;
Region r = new Complement( s1, s2 );
for ( Point p : new Point[] { new Point( .25, .25 ), new Point( .25, 3 ) } ) {
assertEquals( s2.contains( p ), !r.contains( p ));
}
assertFalse( r.contains( new Point( 0, -2 )) );
}
}