Пример #1
0
        public void PathFromIndexBounds(int pIndex, bool pInclusive, bool pThrows)
        {
            IWeaverPath p = NewPath(3);

            WeaverTestUtil.CheckThrows <WeaverPathException>(pThrows,
                                                             () => p.PathFromIndex(pIndex, pInclusive)
                                                             );
        }
Пример #2
0
        public void PathFromIndex(int pIndex, bool pInclusive, int pCount)
        {
            IWeaverPath p = NewPath(5);

            IList <IWeaverPathItem> result = p.PathFromIndex(pIndex, pInclusive);

            Assert.NotNull(result, "Result should be filled.");
            Assert.AreEqual(pCount, result.Count, "Incorrect Result.Count.");

            int pi = pIndex + (pInclusive ? 0 : 1);
            int ri = 0;

            Assert.AreEqual(p.ItemAtIndex(pi), result[ri], "Incorrect Result[" + ri + "].");

            pi = p.Length - 1;
            ri = pCount - 1;
            Assert.AreEqual(p.ItemAtIndex(pi), result[ri], "Incorrect Result[" + ri + "].");
        }