Skip to content

Commit

Permalink
[prmr#547] Update tests to include intersection at rectangle corners.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkcoding7 authored and prmr committed May 21, 2024
1 parent 7d4792c commit 7f98abc
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/org/jetuml/geom/TestGeomUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,30 @@ void testIntersectRectangle_NE_to_Top()
assertEquals(new Point(35,0), GeomUtils.intersectRectangle(aRectangle, Direction.fromAngle(15)));
}

@Test
void testIntersectRectangle_NE_Corner()
{
assertEquals(new Point(60,0), GeomUtils.intersectRectangle(aRectangle, Direction.fromAngle(56)));
}

@Test
void testIntersectRectangle_SE_Corner()
{
assertEquals(new Point(60,40), GeomUtils.intersectRectangle(aRectangle, Direction.fromAngle(124)));
}

@Test
void testIntersectRectangle_SW_Corner()
{
assertEquals(new Point(0,40), GeomUtils.intersectRectangle(aRectangle, Direction.fromAngle(236)));
}

@Test
void testIntersectRectangle_NW_Corner()
{
assertEquals(new Point(0,0), GeomUtils.intersectRectangle(aRectangle, Direction.fromAngle(304)));
}

@Test
void testIntersectCircle_North()
{
Expand Down

0 comments on commit 7f98abc

Please sign in to comment.