2020-01-27 21:39:46 +00:00
|
|
|
import org.junit.Test;
|
2020-01-30 20:30:56 +00:00
|
|
|
import shapes.Line;
|
2020-01-27 21:39:46 +00:00
|
|
|
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
|
|
|
|
public class TestSuite {
|
2020-01-30 20:30:56 +00:00
|
|
|
// TODO: Create tests for shapes.Shapes class.
|
2020-01-29 21:05:08 +00:00
|
|
|
|
2020-01-27 21:39:46 +00:00
|
|
|
@Test
|
2020-01-27 22:49:42 +00:00
|
|
|
public void lineRotationTest1() {
|
2020-01-27 21:39:46 +00:00
|
|
|
Line line = new Line(-0.5, 0.5, 0.5, 0.5);
|
|
|
|
|
2020-01-29 18:47:25 +00:00
|
|
|
assertEquals(new Line(-0.5, -0.5, -0.5, 0.5), line.rotate(Math.PI / 2));
|
|
|
|
assertEquals(new Line(0.5, -0.5, -0.5, -0.5), line.rotate(Math.PI));
|
|
|
|
assertEquals(new Line(0.5, 0.5, 0.5, -0.5), line.rotate(3 * Math.PI / 2));
|
|
|
|
assertEquals(new Line(-0.5, 0.5, 0.5, 0.5), line.rotate(2 * Math.PI));
|
2020-01-27 22:49:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void lineRotationTest2() {
|
|
|
|
Line line = new Line(-0.5, -0.5, -0.25, 0.5);
|
|
|
|
|
2020-01-29 18:47:25 +00:00
|
|
|
assertEquals(new Line(0.5, -0.5, -0.5, -0.25), line.rotate(Math.PI / 2));
|
2020-01-27 21:39:46 +00:00
|
|
|
}
|
|
|
|
}
|