コード例 #1
0
        public void Loading()
        {
            QueryConfigurationLoader  loader          = new QueryConfigurationLoader(@"QueriesForLoaderTest.xml", _storageProviderDefinitionFinder);
            QueryDefinitionCollection actualQueries   = loader.GetQueryDefinitions();
            QueryDefinitionCollection expectedQueries = CreateExpectedQueryDefinitions();

            QueryDefinitionChecker checker = new QueryDefinitionChecker();

            checker.Check(expectedQueries, actualQueries);
        }
コード例 #2
0
        public void GetDefinitions()
        {
            QueryConfiguration configuration = new QueryConfiguration("QueriesForLoaderTest.xml");

            QueryConfigurationLoader  loader          = new QueryConfigurationLoader(@"QueriesForLoaderTest.xml", _storageProviderDefinitionFinder);
            QueryDefinitionCollection expectedQueries = loader.GetQueryDefinitions();

            QueryDefinitionChecker checker = new QueryDefinitionChecker();

            checker.Check(expectedQueries, configuration.QueryDefinitions);
        }
コード例 #3
0
        public void GetDefaultQueryFilePath_BaseDirectory()
        {
            QueryConfiguration configuration = new QueryConfiguration();

            Assert.That(configuration.QueryFiles.Count, Is.EqualTo(0));
            Assert.That(configuration.QueryDefinitions.Count, Is.GreaterThan(0));

            Assert.That(configuration.GetDefaultQueryFilePath(), Is.EqualTo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "queries.xml")));

            QueryConfigurationLoader loader  = new QueryConfigurationLoader(configuration.GetDefaultQueryFilePath(), _storageProviderDefinitionFinder);
            QueryDefinitionChecker   checker = new QueryDefinitionChecker();

            checker.Check(loader.GetQueryDefinitions(), configuration.QueryDefinitions);
        }
コード例 #4
0
        public void GetDefinitions_WithMultipleFiles()
        {
            QueryConfiguration configuration = new QueryConfiguration("QueriesForLoaderTest.xml", "QueriesForLoaderTest2.xml");

            QueryConfigurationLoader  loader1         = new QueryConfigurationLoader(@"QueriesForLoaderTest.xml", _storageProviderDefinitionFinder);
            QueryConfigurationLoader  loader2         = new QueryConfigurationLoader(@"QueriesForLoaderTest2.xml", _storageProviderDefinitionFinder);
            QueryDefinitionCollection expectedQueries = loader1.GetQueryDefinitions();

            expectedQueries.Merge(loader2.GetQueryDefinitions());

            Assert.That(expectedQueries.Count > loader1.GetQueryDefinitions().Count, Is.True);

            QueryDefinitionChecker checker = new QueryDefinitionChecker();

            checker.Check(expectedQueries, configuration.QueryDefinitions);
        }