Esempio n. 1
0
 protected override void InternalVisualize(TestCaseUI ui)
 {
     ui.Rect(new System.Drawing.Rectangle(r1.Left, r1.Top, r1.Width, r1.Height), neutralPen);
     ui.Rect(new System.Drawing.Rectangle(r2.Left, r2.Top, r2.Width, r2.Height), neutralPen);
     ui.Log("r1: {0}", r1);
     ui.Log("r2: {0}", r2);
     ui.Log("Solution: ");
     ui.Log("  intersected: {0} {1}", intersectedAnswer, intersected != intersectedAnswer ? "wrong!" : "");
     ui.Log("  intersection square: {0} {1}", intersectionSquareAnswer, intersectionSquare != intersectionSquareAnswer ? "wrong!" : "");
     ui.Log("  index of inner rectangle: {0} {1}", indexOfInnerRectAnswer, indexOfInnerRectangle != indexOfInnerRectAnswer ? "wrong!" : "");
 }
Esempio n. 2
0
 protected override void InternalVisualize(TestCaseUI ui)
 {
     ui.Rect(r1, neutralPen);
     ui.Rect(r2, neutralPen);
     ui.Log("r1: {0}", r1);
     ui.Log("r2: {0}", r2);
     ui.Log("Solution: ");
     ui.Log("  intersected: {0} {1}", intersectedAnswer, intersected != intersectedAnswer ? "wrong!" : "");
     ui.Log("  intersection square: {0} {1}", intersectionSquareAnswer, intersectionSquare != intersectionSquareAnswer ? "wrong!" : "");
     ui.Log("  index of inner rectangle: {0} {1}", indexOfInnerRectAnswer, indexOfInnerRectangle != indexOfInnerRectAnswer ? "wrong!" : "");
 }
        protected override void InternalVisualize(TestCaseUI ui)
        {
            // Добавляет оси координат:
            //   - красная — OY
            //   - зеленая — OX
            ui.Line(0, 0, 0, 50, actualAnswerPen);
            ui.Line(0, 0, 50, 0, expectedAnswerPen);

            ui.Rect(new System.Drawing.Rectangle(r1.Left, r1.Top, r1.Width, r1.Height), neutralPen);
            ui.Rect(new System.Drawing.Rectangle(r2.Left, r2.Top, r2.Width, r2.Height), neutralPen);
            ui.Log("r1: {0}", r1);
            ui.Log("r2: {0}", r2);
            ui.Log("Solution: ");
            ui.Log("  intersected: {0} {1}", intersectedAnswer, intersected != intersectedAnswer ? "wrong!" : "");
            ui.Log("  intersection square: {0} {1}", intersectionSquareAnswer,
                   intersectionSquare != intersectionSquareAnswer ? "wrong!" : "");
            ui.Log("  index of inner rectangle: {0} {1}", indexOfInnerRectAnswer,
                   indexOfInnerRectangle != indexOfInnerRectAnswer ? "wrong!" : "");
        }
Esempio n. 4
0
        private void DrawWall(TestCaseUI ui, int x, int y)
        {
            var x1 = x * cellSize - 100;
            var y1 = y * cellSize - 100;
            var x2 = (x + 1) * cellSize - 101;
            var y2 = (y + 1) * cellSize - 101;

            ui.Rect(new Rectangle(x1, y1, cellSize, cellSize), neutralPen);
            ui.Line(x1, y1, x2, y2, neutralPen);
            ui.Line(x1, y2, x2, y1, neutralPen);
        }
Esempio n. 5
0
        protected override void InternalVisualize(TestCaseUI ui)
        {
            ui.Log("Calculated area: " + calculatedArea);
            ui.Log("Calculated isConvex: " + calculatedIsConvex);
            ui.Log("Expected area: " + area);
            ui.Log("Expected isConvex: " + isConvex);
            ui.Rect(new Rectangle(-90, -90, 180, 180), new Pen(Color.FromArgb(50, Color.Green), 1));
            Action <PointF> plot = p => ui.Circle(p.X, p.Y, 3, neutralPen);
            PointF          prev = scaledPoints.Last();

            foreach (var curr in scaledPoints)
            {
                plot(curr);
                ui.Line(prev.X, prev.Y, curr.X, curr.Y, neutralThinPen);
                prev = curr;
            }
        }