コード例 #1
0
        public void CreateNonExistantConfigurationStream()
        {
            AssertFileDoesNotExist("./CreateNonExistantConfiguration.xml");
            var config = new njFileConfiguration(new FileStream("./CreateNonExistantConfiguration.xml", FileMode.CreateNew), true);

            config.LoadConfiguration();
            Assert.IsTrue(config.IsValid);
            config.Dispose();
        }
コード例 #2
0
        public void ReadOnlyNonExistantConfiguration()
        {
            AssertFileDoesNotExist("./ReadOnlyNonExistantConfiguration.xml");
            var config = new njFileConfiguration("./ReadOnlyNonExistantConfiguration.xml", false);

            config.LoadConfiguration();
            Assert.IsFalse(config.IsValid);
            config.Dispose();
        }
コード例 #3
0
        public void OpenSimpleConfigOneEntryStream()
        {
            var config = new njFileConfiguration(new FileStream("./TestData/SimpleConfigOneEntry.xml", FileMode.Open), false);

            config.LoadConfiguration();
            Assert.IsTrue(config.IsValid);
            Assert.AreEqual(1, config?.Count, "Falsche Anzahl an Items");

            config.Dispose();
        }