Ejemplo n.º 1
0
		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());
		}
Ejemplo n.º 2
0
		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);
		}
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
        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);
        }