Package purrpackagedemo.aggregate

Source Code of purrpackagedemo.aggregate.TestComplement

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 )) );
  }

 
}
TOP

Related Classes of purrpackagedemo.aggregate.TestComplement

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.