public void EntryResultCount()
        {
            var t = new TraversalOperation();
            IList <FabElement> results = t.Execute(OpCtx, "Vertices/WhereTimestamp(gt,1)");

            Assert.NotNull(results, "Results should be filled.");
            Assert.AreEqual(100, results.Count, "Incorrect results count.");
        }
Example #2
0
        public void Traverse(TraversalOperation traversaloperation)
        {
            if (root == null)
            {
                return;
            }

            root.Traverse(traversaloperation);
            traversaloperation(ref root);
        }
        public void UsersWithName(string pName)
        {
            var t = new TraversalOperation();
            IList <FabElement> results = t.Execute(OpCtx, "Users/WithName(" + pName + ")");

            Assert.NotNull(results, "Results should be filled.");
            Assert.AreEqual(1, results.Count, "Incorrect results count.");

            FabUser user = (results[0] as FabUser);

            Assert.NotNull(user, "Result should be a FabUser.");
            Assert.AreEqual(pName.ToLower(), user.Name.ToLower(), "Incorrect user Name.");
        }
Example #4
0
            /// <summary>
            /// Traverses the entire Octree and performs a function on each node.
            /// </summary>
            /// <param name="traversaloperation">The operation to perform on each node.</param>
            public void Traverse(TraversalOperation traversaloperation)
            {
                if (this.TopLeftBack != null)
                {
                    this.TopLeftBack.Traverse(traversaloperation);
                    traversaloperation(ref this.TopLeftBack);
                }

                if (this.TopLeftFront != null)
                {
                    this.TopLeftFront.Traverse(traversaloperation);
                    traversaloperation(ref this.TopLeftFront);
                }

                if (this.TopRightBack != null)
                {
                    this.TopRightBack.Traverse(traversaloperation);
                    traversaloperation(ref this.TopRightBack);
                }

                if (this.TopRightFront != null)
                {
                    this.TopRightFront.Traverse(traversaloperation);
                    traversaloperation(ref this.TopRightFront);
                }

                if (this.BottomLeftFront != null)
                {
                    this.BottomLeftFront.Traverse(traversaloperation);
                    traversaloperation(ref this.BottomLeftFront);
                }

                if (this.BottomLeftBack != null)
                {
                    this.BottomLeftBack.Traverse(traversaloperation);
                    traversaloperation(ref this.BottomLeftBack);
                }

                if (this.BottomRightFront != null)
                {
                    this.BottomRightFront.Traverse(traversaloperation);
                    traversaloperation(ref this.BottomRightFront);
                }

                if (this.BottomRightBack != null)
                {
                    this.BottomRightBack.Traverse(traversaloperation);
                    traversaloperation(ref this.BottomRightBack);
                }
            }
Example #5
0
        public void SetUp()
        {
            vAuthMemId = 134632634;

            vMockAuth = new Mock <IOperationAuth>(MockBehavior.Strict);
            vMockAuth.SetupGet(x => x.ActiveMemberId).Returns(vAuthMemId);

            vMockData = new Mock <IOperationData>(MockBehavior.Strict);

            vMockOpCtx = new Mock <IOperationContext>(MockBehavior.Strict);
            vMockOpCtx.SetupGet(x => x.Auth).Returns(vMockAuth.Object);
            vMockOpCtx.SetupGet(x => x.Data).Returns(vMockData.Object);

            vOper = new TraversalOperation();
        }
Example #6
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        private static IApiResponse TravResp(IApiRequest pApiReq)
        {
            FabTravStep[] steps = null;

            Func <IList <FabElement> > getResp = (() => {
                string path = pApiReq.Path;
                path = path.Substring(path.ToLower().IndexOf("trav/") + 5);               //remove "/Trav/"

                var op = new TraversalOperation();

                IList <FabElement> result = op.Execute(pApiReq.OpCtx, path);
                steps = op.GetResultSteps().ToArray();
                return(result);
            });

            var exec = new FabResponseExecutor <FabElement>(pApiReq, getResp);

            exec.NewFabResponse = (() => new FabTravResponse <FabElement> {
                Steps = steps
            });
            return(exec.Execute());
        }