Package purrpackagedemo.aggregate

Source Code of purrpackagedemo.aggregate.TestUnion

package purrpackagedemo.aggregate;

import junit.framework.TestCase;

import org.junit.Test;

import purrpackagedemo.Point;
import purrpackagedemo.Region;
import purrpackagedemo.Transformation;
import purrpackagedemo.polygon.Polygon;

public class TestUnion extends TestCase {

  @Test
  public void testContains() {
    Region s1 = Polygon.UNIT_SQUARE;
    Region s2 = new Transformation.Translation( .5, .5 ).apply( s1 );
    Union u = new Union( s1, s2 );
    assertTrue( u.contains( new Point( 0.5, 0.5 )));
    assertTrue( u.contains( new Point( 0.25, 0.25 )));
    assertTrue( u.contains( new Point( 1.25, 1.25 )));
    assertFalse( u.contains( new Point( .25, 1.25 )));
    assertFalse( u.contains( new Point( 7, 7 )));
  }

 
}
TOP

Related Classes of purrpackagedemo.aggregate.TestUnion

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.