Пример #1
0
        public void CreatePentagonTest_With1Points()
        {
            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));

            shapeBUS.CreatePentagon();
        }
Пример #2
0
        public void GetShapesTest1()
        {
            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));
            shapeBUS.AddPoint(new Point(5, 5));
            shapeBUS.AddPoint(new Point(6, 5));
            shapeBUS.AddPoint(new Point(9, 5));
            shapeBUS.AddPoint(new Point(15, 5));

            shapeBUS.CreatePentagon();

            shapeBUS.GetShapes("testing.xaml");
        }
Пример #3
0
        public void FillShapeTest2()
        {
            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));
            shapeBUS.AddPoint(new Point(5, 5));
            shapeBUS.AddPoint(new Point(6, 5));
            shapeBUS.AddPoint(new Point(9, 5));
            shapeBUS.AddPoint(new Point(15, 5));

            shapeBUS.CreatePentagon();

            Color color = Color.FromRgb(255, 255, 255);

            shapeBUS.FillShape(color);
        }
Пример #4
0
        public void MoveShapeTest1()
        {
            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));
            shapeBUS.AddPoint(new Point(5, 5));
            shapeBUS.AddPoint(new Point(6, 5));
            shapeBUS.AddPoint(new Point(9, 5));
            shapeBUS.AddPoint(new Point(15, 5));

            shapeBUS.CreatePentagon();

            shapeBUS.ChooseShape("Pentagon_1");

            shapeBUS.SetShapeMarginAndStartMovePoint(new Point(0, 1));
            shapeBUS.MoveShape(new Point(2, 3));
        }
Пример #5
0
        public void FillShapeTest1()
        {
            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));
            shapeBUS.AddPoint(new Point(5, 5));
            shapeBUS.AddPoint(new Point(6, 5));
            shapeBUS.AddPoint(new Point(9, 5));
            shapeBUS.AddPoint(new Point(15, 5));

            shapeBUS.CreatePentagon();

            shapeBUS.ChooseShape("Pentagon_1");

            Color color = Color.FromRgb(0, 0, 0);

            shapeBUS.FillShape(color);
        }
Пример #6
0
        public void SaveShapesTest1()
        {
            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));
            shapeBUS.AddPoint(new Point(5, 5));
            shapeBUS.AddPoint(new Point(6, 5));
            shapeBUS.AddPoint(new Point(9, 5));
            shapeBUS.AddPoint(new Point(15, 5));

            shapeBUS.CreatePentagon();

            shapeBUS.SaveShapes("test.xaml");

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

            Assert.IsTrue(fileText.ToString().Length > 1);
        }
Пример #7
0
        public void ChooseShapeTest()
        {
            shapeBUS = new ShapeBUS();
            shapeBUS.AddPoint(new Point(0, 0));
            shapeBUS.AddPoint(new Point(5, 5));
            shapeBUS.AddPoint(new Point(6, 5));
            shapeBUS.AddPoint(new Point(9, 5));
            shapeBUS.AddPoint(new Point(15, 5));

            shapeBUS.CreatePentagon();

            shapeBUS.ChooseShape("Pentagon_1");

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

            Assert.AreEqual(expected, actual);
        }