public static void Test_RectangleTouchCircle(int w, int h, int x1, int y1, int r, int x2, int y2, bool result) { var rect = new RectangleGameObject() { Size = new Size(w, h), Position = new Point(x1, y1) }; var circle = new CircleGameObject(new Size(r, r)) { Position = new Point(x2, y2) }; Assert.AreEqual(result, circle.IsCollided(rect)); }
public static void Test_TwoCircleIsTouch(int h, int x1, int y1, int x2, int y2, bool result) { var firstCircle = new CircleGameObject(new Size(h, h)) { Position = new Point(x1, y1) }; var secondCircle = new CircleGameObject(new Size(h, h)) { Position = new Point(x2, y2) }; Assert.AreEqual(result, firstCircle.IsCollided(secondCircle)); }