added a scale test

This commit is contained in:
RustyRaptor committed 2020-12-12 23:33:39 -07:00
1 parent ac13736135
commit 0eb3c93610
1 file changed
+32
@@ -64,6 +64,38 @@ public class Circle2Test {
p = circle2.moveBy(2, 3);
Assert.assertTrue(p.x == 3 && p.y == 5);
}
//
// Test negative with different values
//
@Test
public void simpleMoveNegDiff() {
Point p;
System.out.println("Running test simpleMoveDiff.");
p = circle2.moveBy(-2, -3);
Assert.assertTrue(p.x == -1 && p.y == -1);
}
//
// Test scaling with a positive value
//
@Test
public void simpleScale() {
Point p;
System.out.println("Running test simpleMoveDiff.");
circle2.scale(2);
Assert.assertTrue(circle2.radius == 6);
}
//
// Test scaling with a fractional value
//
@Test
public void simpleScaleFrac() {
Point p;
System.out.println("Running test simpleScaleFrac.");
circle2.scale(2.5);
Assert.assertTrue(circle2.radius == 7.5);
}
public static void main(String args[]) {
try {