public void TestPlannerWithCypherPlannerVariant(CypherPlanner input, string expected)
        {
            var client = Substitute.For <IRawGraphClient>();

            client.CypherCapabilities.Returns(CypherCapabilities.Cypher22);

            var query = new CypherFluentQuery(client)
                        .Planner(input)
                        .Query;

            Assert.Equal(string.Format("PLANNER {0}", expected), query.QueryText);
        }
Exemplo n.º 2
0
        public void TestPlannerWithCypherPlannerVariant(
            [Values(CypherPlanner.CostGreedy, CypherPlanner.CostIdp, CypherPlanner.Rule)] CypherPlanner input,
            [Values("COST", "IDP", "RULE")] string expected)
        {
            var client = Substitute.For <IRawGraphClient>();

            client.CypherCapabilities.Returns(CypherCapabilities.Cypher22);

            var query = new CypherFluentQuery(client)
                        .Planner(input)
                        .Query;

            Assert.AreEqual(string.Format("PLANNER {0}", expected), query.QueryText);
        }
Exemplo n.º 3
0
        public ICypherFluentQuery Planner(CypherPlanner planner)
        {
            switch (planner)
            {
            case CypherPlanner.Rule:
                return(Planner("RULE"));

            case CypherPlanner.CostIdp:
                return(Planner("IDP"));

            case CypherPlanner.CostGreedy:
                return(Planner("COST"));

            default:
                throw new ArgumentOutOfRangeException("planner", planner, null);
            }
        }
Exemplo n.º 4
0
 public virtual ICypherFluentQuery Planner(CypherPlanner planner)
 {
     return(this);
 }