public IEnumerable <Environment> GetAll() { if (_environments == null) { string configPath = _configLocator.ResolveConfigFile("environments.json"); string json = File.ReadAllText(configPath); List <Environment> environments = JsonConvert.DeserializeObject <List <Environment> >(json); _environments = environments.OrderBy(x => x.Order).ToList(); } return(_environments); }
public IConfiguration Load() { if (_configuration == null) { string configPath = _configLocator.ResolveConfigFile("configuration.json"); string json = File.ReadAllText(configPath); JsonConfiguration configuration = JsonConvert.DeserializeObject <JsonConfiguration>(json); configuration.TestFilesBaseDirectory = ResolveRelativePath(configuration.TestFilesBaseDirectory); configuration.ScriptSnippetDirectory = ResolveRelativePath(configuration.ScriptSnippetDirectory); _configuration = configuration; } return(_configuration); }