Skip to content

Commit

Permalink
Added a new JUnit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jdiemke committed May 26, 2016
1 parent 5c1440f commit 4448ee6
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,18 @@ public void testAddTriangle() {
Assert.assertEquals("The triangle soup should contain exactly one triangle.", 1, triangles.size());
}

@Test
public void testRemoveTriangle() {
TriangleSoup soup = new TriangleSoup();
Triangle2D triangle = new Triangle2D(new Vector2D(0, 0), new Vector2D(1, 0), new Vector2D(1, 1));

soup.add(triangle);
soup.remove(triangle);

List<Triangle2D> triangles = soup.getTriangles();

Assert.assertNotNull("The returned list should not be null.", triangles);
Assert.assertEquals("The triangle soup should not contain any triangles.", 0, triangles.size());
}

}

0 comments on commit 4448ee6

Please sign in to comment.