Esempio n. 1
0
        public void _1_UpdatemachineStateL2RBoxEndupOutside2()
        {
            //arrange
            PathSection pathSection         = getPathSection(true, true);
            ColoBox     currentBoxReference = getBox(0, true);

            currentBoxReference.MoveOriginTo(new Point {
                X = 456, Y = 459
            });
            pathSection.machine.CurrentBoxToPlace = currentBoxReference;

            //act
            Point?res = pathSection.UpdateMachineState(currentBoxReference);

            //assert
            Assert.AreEqual(pathSection.UpperPathSections[0].RelativeLocation.Value, RelativeLocation.Outside);
            Assert.AreEqual(pathSection.UpperPathSections[1].RelativeLocation.Value, RelativeLocation.Inside);
        }
Esempio n. 2
0
        public void UpdateMachineStateL2RPath1()
        {
            //arrange
            PathSection pathSection         = getPathSection(true, true);
            double      maxY                = 335;
            ColoBox     currentBoxReference = getBox(maxY, true);

            currentBoxReference.MoveOriginTo(new Point {
                X = 490, Y = maxY
            });
            pathSection.machine.CurrentBoxToPlace = currentBoxReference;

            //act
            Point?res = pathSection.UpdateMachineState(currentBoxReference);

            //assert
            Assert.AreEqual(res.Value.X, 532);
            Assert.AreEqual(res.Value.Y, 335);
        }
Esempio n. 3
0
        public void UpdateMachineStateR2LPath2()
        {
            //arrange
            PathSection pathSection         = getPathSection(false, true);
            double      maxY                = 335;
            ColoBox     currentBoxReference = getBox(maxY, true);

            currentBoxReference.MoveOriginTo(new Point {
                X = 530, Y = maxY
            });
            pathSection.machine.CurrentBoxToPlace = currentBoxReference;

            //act
            Point?res = pathSection.UpdateMachineState(currentBoxReference);

            //assert
            Assert.AreEqual(res, null);
            Assert.AreEqual(pathSection.machine.IsInsideBoundingBox, false);
        }
Esempio n. 4
0
        public void UpdateMachineStateL2RPath4()
        {
            //arrange
            PathSection pathSection         = getPathSection(true, true);
            double      maxY                = 563.92;//-529.92;
            ColoBox     currentBoxReference = getBox(maxY);

            currentBoxReference.MoveOriginTo(new Point {
                X = 464, Y = 335
            });
            pathSection.machine.CurrentBoxToPlace = currentBoxReference;

            //act
            Point?res = pathSection.UpdateMachineState(currentBoxReference);

            //assert
            Assert.AreEqual(res, null);
            Assert.AreEqual(pathSection.machine.IsInsideBoundingBox, false);
        }
Esempio n. 5
0
        public void UpdatemachineStateR2LBoxEndupOutside()
        {
            //arrange
            PathSection pathSection         = getPathSection(false, true);
            double      maxY                = 415;
            ColoBox     currentBoxReference = getBox(maxY, true);

            currentBoxReference.MoveOriginTo(new Point {
                X = 456, Y = maxY
            });
            pathSection.machine.CurrentBoxToPlace = currentBoxReference;

            //act
            Point?res = pathSection.UpdateMachineState(currentBoxReference);

            //assert
            Assert.AreEqual(pathSection.LowerPathSections[0].RelativeLocation.Value, RelativeLocation.Outside);
            Assert.AreEqual(pathSection.LowerPathSections[1].RelativeLocation.Value, RelativeLocation.Inside);
            Assert.AreEqual(pathSection.LowerPathSections[2].RelativeLocation.Value, RelativeLocation.Outside);
        }