LineTest.java - import import import import import org.junit.Assert static org.junit.Assert org.junit.Before org.junit.Test java.util.Iterator public

LineTest.java - import import import import import...

This preview shows page 1 - 2 out of 4 pages.

import org.junit.Assert; import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; import java.util.Iterator; public class LineTest { /* Temporary Tests */ /* Collinear Test @Test public void collinearTest() { Point a = new Point(0,0); Point b = new Point(5,5); Point c = new Point(4,4); Line line = new Line(); line.add(a); line.add(b); boolean actual = line.isCollinear(c); assertEquals(true, actual); } @Test public void collinearTest2() { Point a = new Point(0,0); Point b = new Point(5,5); Point c = new Point(4,3); Line line = new Line(); line.add(a); line.add(b); boolean actual = line.isCollinear(c); assertEquals(false, actual); } @Test public void collinearTest3() { Point a = new Point(0,0); Point b = new Point(5,5); Point c = new Point(4,4); Line line = new Line(); line.add(b); line.add(c); boolean actual = line.isCollinear(a); assertEquals(true, actual); } */ /*******************************************************/ /*********************ADD TESTS*************************/ /*******************************************************/ //First test is an empty line @Test public void addTest1() { Point a = new Point(0,0); Line line = new Line(); assertEquals(true, line.add(a)); //Checks if true/false works assertEquals("(0, 0)", line.toString()); //Checks if actually added } //Tests when it only has one item in line
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read all 4 pages?

  • Spring '10
  • HENDRIX

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes