コード例 #1
0
        public void AddRectangle()
        {
            Point Loc      = new Point(30, -30);
            bool  expected = true;

            PetriNets.PetriNet p = new PetriNets.PetriNet();
            bool actual          = p.DrawRectangle(Loc);

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void DellRectangle()
        {
            Point Loc      = new Point(30, -30);
            bool  expected = true;

            PetriNets.PetriNet p = new PetriNets.PetriNet();
            bool actual2         = p.DrawRectangle(Loc);

            p.hitTest(Loc);
            bool actual = p.selectedShape.delete(p.Shapes);

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void AddLine()        // не пашет
        {
            Point Loc      = new Point(30, -30);
            Point Loc2     = new Point(60, -30);
            bool  expected = true;

            PetriNets.PetriNet p = new PetriNets.PetriNet();
            p.DrawCircle(Loc);
            p.DrawRectangle(Loc2);
            p.hitTest(Loc);
            p.createNewLine(Loc);
            p.hitTest(Loc2);
            bool actual = p.resizingLine(Loc2);

            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void DellLine()
        {
            Point Loc      = new Point(30, -30);
            Point Loc2     = new Point(60, -30);
            Point Loc3     = new Point(45, -30);
            bool  expected = true;

            PetriNets.PetriNet p = new PetriNets.PetriNet();
            p.DrawCircle(Loc);
            p.DrawRectangle(Loc2);
            p.hitTest(Loc);
            p.createNewLine(Loc);
            p.hitTest(Loc2);
            p.resizingLine(Loc2);
            p.hitTestWithLine(new Point((Loc.X + Loc2.X) / 2, (Loc.Y + Loc2.Y) / 2));
            bool actual = p.selectedShape.delete(p.Shapes);

            Assert.AreEqual(expected, actual);
        }