public void LoadAll_LoadAll_ThrowsKeyNotFoundExceptionOnNonExistingConfig() { Assume.That(Directory.Exists(nJupiterConfigPath)); Assume.That(!File.Exists(nJupiterConfigPath + "NotExistingConfigFile.config")); var c = new Config("testconfig", GetConfigXmlDocument(configForConfigFolder)); var fileConfigLoader = new FileConfigLoader(c); var configs = fileConfigLoader.LoadOnInit(); Assert.Throws<KeyNotFoundException>(() => configs["NotExistingConfigFile"].ToString()); }
public void LoadAll_LoadnjupiterConfigFolder_ReturnCorrectNumberOfConfigs() { Assume.That(Directory.Exists(nJupiterConfigPath)); var c = new Config("testconfig", GetConfigXmlDocument(configForConfigFolder)); var fileConfigLoader = new FileConfigLoader(c); var configs = fileConfigLoader.LoadOnInit(); var count = configs.Count(); var acctualCount = Directory.GetFiles(nJupiterConfigPath, "*.config").Length; Assert.AreEqual(acctualCount, count); }
public void LoadAll_LoadAll_ThrowsKeyNotFoundExceptionOnNonExistingConfig() { Assume.That(Directory.Exists(nJupiterConfigPath)); Assume.That(!File.Exists(nJupiterConfigPath + "NotExistingConfigFile.config")); var c = new Config("testconfig", GetConfigXmlDocument(configForConfigFolder)); var fileConfigLoader = new FileConfigLoader(c); var configs = fileConfigLoader.LoadOnInit(); Assert.Throws <KeyNotFoundException>(() => configs["NotExistingConfigFile"].ToString()); }