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); }
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); }
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); }
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); }