Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.junit.Before;
- import org.junit.Test;
- import static org.junit.Assert.*;
- import java.math.BigInteger;
- public class Testtriangle {
- private Rtriangle triangle;
- @Before
- public void setUp() {
- triangle = RtriangleProvider.getRtriangle();
- }
- @Test
- public void test() {
- long ax1=((long)triangle.getApexX1()-triangle.getApexX2());
- long ay1=((long)triangle.getApexY1()-triangle.getApexY2());
- long ax2=((long)triangle.getApexX2()-triangle.getApexX3());
- long ay2=((long)triangle.getApexY2()-triangle.getApexY3());
- long ax3=((long)triangle.getApexX3()-triangle.getApexX1());
- long ay3=((long)triangle.getApexY3()-triangle.getApexY1());
- long a2 = ax1 * ax1 + ay1 + ay1;
- assertTrue(a2 != 0);
- long b2 = ax2 * ax2 + ay2 + ay2;
- assertTrue(b2 != 0);
- long c2 = ax3 * ax3 + ay3 + ay3;
- assertTrue(c2 != 0);
- assertNotEquals(a2 + b2, c2);
- assertNotEquals(b2 + c2, a2);
- assertNotEquals(a2 + c2, b2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement