Example #1
0
        public static void SwitchForTask2(int value)
        {
            switch (value)
            {
            case 1:
                Task2.Figure rectangle = new Task2.Rectangle(5, 7);
                Task2.Figure square    = new Task2.Square(2);
                Console.WriteLine(rectangle.Draw());
                Console.WriteLine(square.Draw());
                break;

            case 2:
                Task2.VirtualDraw.Figure    figure     = new Task2.VirtualDraw.Figure(2, 3);
                Task2.VirtualDraw.Rectangle rectangle1 = new Task2.VirtualDraw.Rectangle(4, 5);
                Task2.VirtualDraw.Square    square1    = new Task2.VirtualDraw.Square(7, 8);

                Console.WriteLine(figure.Draw());
                Console.WriteLine(rectangle1.Draw());
                Console.WriteLine(square1.Draw());
                break;

            case 3:
                Task2.FigureWithInterface.IDrawable[] arr = new Task2.FigureWithInterface.IDrawable[3];

                arr[0] = new Task2.FigureWithInterface.Figure(1, 2);
                arr[1] = new Task2.FigureWithInterface.Rectangle(3, 4);
                arr[2] = new Task2.FigureWithInterface.Square(5, 6);
                DrawAll(arr);
                break;
            }
        }
Example #2
0
 public void VirtualSquare()
 {
     Assert.AreEqual(square3.Draw(), "Square");
 }