public QuerySetup FakeResultQuerySetup(FacetsConfig2 facetsConfig, string resultFacetCode, string specificationKey)
        {
            var resultFields     = Registry.Results.GetFieldsByKey(specificationKey);
            var fakeJoins        = FakeJoinsClause(5);
            var joinCompiler     = MockJoinsClauseCompiler(fakeJoins);
            var fakePickCriteria = new List <string> {
                "ID IN (1,2,3)"
            };
            var mockPicksCompiler = MockPicksFilterCompiler(fakePickCriteria);
            var facetsGraph       = ScaffoldUtility.DefaultFacetsGraph(Registry);
            var resultFacet       = Registry.Facets.GetByCode(resultFacetCode);

            // FIXME: Should be mocked
            var compiler   = new QuerySetupBuilder(facetsGraph, mockPicksCompiler.Object, joinCompiler.Object);
            var querySetup = compiler.Build(facetsConfig, resultFacet, resultFields);

            return(querySetup);
        }
        public QuerySetup FakeCountOrContentQuerySetup(FacetsConfig2 facetsConfig)
        {
            List <string> fakeJoins        = FakeJoinsClause(5);
            var           joinsCompiler    = MockJoinsClauseCompiler(fakeJoins);
            var           fakePickCriteria = new List <string> {
                "ID IN (1,2,3)"
            };
            var mockPicksCompiler = MockPicksFilterCompiler(fakePickCriteria);
            var facetsGraph       = ScaffoldUtility.DefaultFacetsGraph(Registry);

            // FIXME: Should be mocked
            var compiler = new QuerySetupBuilder(facetsGraph, mockPicksCompiler.Object, joinsCompiler.Object);

            var querySetup = compiler.Build(
                facetsConfig,
                facetsConfig.TargetFacet,
                new List <string>(),
                null
                );

            return(querySetup);
        }
Beispiel #3
0
 private IFacetsGraph CreateFacetsGraphByFakeContext(IFacetContext testContext)
 {
     return(ScaffoldUtility.DefaultFacetsGraph(testContext));
 }