예제 #1
0
        public void CreateEllipseTest_With1Points()
        {
            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));

            shapeBUS.CreateEllipse();
        }
예제 #2
0
        public void SaveShapesTest1()
        {
            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));
            shapeBUS.AddPoint(new Point(5, 5));
            shapeBUS.CreateEllipse();

            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));
            shapeBUS.AddPoint(new Point(5, 8));
            shapeBUS.AddPoint(new Point(5, 4));
            shapeBUS.AddPoint(new Point(0, 0));
            shapeBUS.CreatePolygon();

            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));
            shapeBUS.AddPoint(new Point(3, 50));
            shapeBUS.CreatePolyline();

            shapeBUS.AddPoint(new Point(5, 5));
            shapeBUS.CreatePolyline();

            shapeBUS.SaveShapes("test.xaml");

            var fileText = File.ReadLines("test.xaml");

            Assert.IsTrue(fileText.ToString().Length > 1);
        }
예제 #3
0
        public void GetShapesTest1()
        {
            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));
            shapeBUS.AddPoint(new Point(5, 5));

            shapeBUS.CreateEllipse();
            shapeBUS.GetShapes("dd.xaml");
        }
예제 #4
0
        public void NewShapeForCancasTest2()
        {
            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));
            shapeBUS.AddPoint(new Point(5, 5));

            shapeBUS.CreateEllipse();

            CanvasBUS.NewShapeForCancas(shapeBUS.Shapes[0] as EllipseShape);
        }
예제 #5
0
        public void ChooseShapeTest()
        {
            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));
            shapeBUS.AddPoint(new Point(5, 6));

            shapeBUS.CreateEllipse();

            shapeBUS.ChooseShape("Ellipse 1");

            int expected = 0;
            int actual   = shapeBUS.ChoosenShapeIndex;

            Assert.AreEqual(expected, actual);
        }