public TypeCheckerTest() { var currentDirectory = Directory.GetParent(Directory.GetCurrentDirectory()); var config = new Dictionary <string, object> { { ConfigurationManager.MetadataDirKey, Path.Combine(currentDirectory.Parent?.Parent?.ToString(), "Resources") } }; var configurationProvider = new MockConfigurationProvider(config); var environment = new MockEnvironment(); var fileMetadataAccessor = new FileMetadataAccessor(); fileMetadataAccessor.SetMetadataPath((string)config[ConfigurationManager.MetadataDirKey]); var cache = new MockCache(); var configurationManager = new ConfigurationManager(configurationProvider, environment, cache); _metadataProvider = configurationManager.NewMetadataProvider(); }
public FileMetadataAccessorTest() { var currentDirectory = Directory.GetParent(Directory.GetCurrentDirectory()); _metadataPath = Path.Combine(currentDirectory.Parent?.Parent?.ToString(), "Resources", "accessor_metadatas"); _accessor = new FileMetadataAccessor(); _accessor.SetMetadataPath(_metadataPath); }
public static ConfigurationManager BuildAs(bool isProd) { var currentDirectory = Directory.GetParent(Directory.GetCurrentDirectory()); var config = new Dictionary <string, object> { { ConfigurationManager.MetadataDirKey, Path.Combine(currentDirectory.Parent?.Parent?.ToString(), "Resources", "provider_metadatas") } }; var configurationProvider = new MockConfigurationProvider(config); var environment = new MockEnvironment(isProd); var fileMetadataAccessor = new FileMetadataAccessor(); fileMetadataAccessor.SetMetadataPath((string)config[ConfigurationManager.MetadataDirKey]); var cache = new MockProdCache(fileMetadataAccessor); return(new ConfigurationManager(configurationProvider, environment, cache)); }
public MockProdCache(FileMetadataAccessor fileMetadataAccessor) { _fileMetadataAccessor = fileMetadataAccessor; }