Skip to content

Instantly share code, notes, and snippets.

@mmaridev
Last active April 10, 2021 08:40
Show Gist options
  • Save mmaridev/d4eb9c594ac54cc0be5d35b3216f5ccf to your computer and use it in GitHub Desktop.
Save mmaridev/d4eb9c594ac54cc0be5d35b3216f5ccf to your computer and use it in GitHub Desktop.
add test for perimeter
@Test
void trianglePerimeterTest() {
// Copyright (C) Marco Marinello <[email protected]>
assertTrue(new Triangle(new Point(6,4), new Point(14,4), new Point(6,10)).perimeter() == 24);
assertTrue(new Triangle(new Point(6,10), new Point(6,4), new Point(14,4)).perimeter() == 24);
assertTrue(new Triangle(new Point(14,4), new Point(6,10), new Point(6,4)).perimeter() == 24);
assertTrue(new Triangle(new Point(30,15), new Point(45,35), new Point(60,15)).perimeter() == 80);
}
@Aboelsebah
Copy link

nice one 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment