Ejemplo n.º 1
0
        public void TestConcat()
        {
            int            count  = 50;
            List <Pose>    poses1 = poseHelper.RandomPoses(count).ToList();
            List <Pose>    poses2 = poseHelper.RandomPoses(count).ToList();
            List <Pose>    poses  = poses1.Concat(poses2).ToList();
            ICartesianPath path1  = new CartesianPath(poses1);
            ICartesianPath path2  = new CartesianPath(poses2);
            ICartesianPath path   = path1.Concat(path2);

            for (int i = 0; i < 2 * count; ++i)
            {
                Assert.Equal(poses[i], path[i]);
            }
            Assert.Equal(2 * count, path.Count());
        }
Ejemplo n.º 2
0
        public void TestSub()
        {
            int            count   = 10;
            List <Pose>    poses   = poseHelper.RandomPoses(count).ToList();
            ICartesianPath pathBig = new CartesianPath(poses);
            int            beg     = 2;
            int            end     = 5;
            ICartesianPath path    = pathBig.Sub(beg, end);

            Assert.Equal(end - beg, path.Count());
            for (int i = 0; i < end - beg; ++i)
            {
                Assert.Equal(pathBig[i + beg], path[i]);
            }

            Assert.Throws <ArgumentOutOfRangeException>(() => path.Sub(0, count + 1));
            Assert.Throws <ArgumentOutOfRangeException>(() => path.Sub(-1, count - 1));
        }