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(); }
public void ReadOnlyNonExistantConfiguration() { AssertFileDoesNotExist("./ReadOnlyNonExistantConfiguration.xml"); var config = new njFileConfiguration("./ReadOnlyNonExistantConfiguration.xml", false); config.LoadConfiguration(); Assert.IsFalse(config.IsValid); config.Dispose(); }
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(); }