public void TestLoad() { GrepSettings storage = GrepSettings.Instance; storage.Clear(); Assert.Empty(storage); storage["test"] = "hello"; storage.Save(destinationFolder + "\\test.xml"); storage.Clear(); Assert.Empty(storage); storage.Load(destinationFolder + "\\test.xml"); Assert.True(storage["test"] == "hello"); }
public void TestDataTypes() { GrepSettings storage = GrepSettings.Instance; storage.Clear(); Assert.Empty(storage); storage.Set("size", 10); storage.Set("isTrue", true); storage.Save(destinationFolder + "\\test.xml"); storage.Clear(); Assert.Empty(storage); storage.Load(destinationFolder + "\\test.xml"); Assert.Equal(10, storage.Get <int>("size")); Assert.True(storage.Get <bool>("isTrue")); }
public void TestDataTypes() { GrepSettings storage = GrepSettings.Instance; storage.Clear(); Assert.Empty(storage); storage.Set <int>("size", 10); storage.Set <bool>("isTrue", true); storage.Save(sourceFolder + "\\test.xml"); storage.Clear(); Assert.Empty(storage); storage.Load(sourceFolder + "\\test.xml"); Assert.Equal <int>(storage.Get <int>("size"), 10); Assert.Equal <bool>(storage.Get <bool>("isTrue"), true); }
public void TestSave() { GrepSettings storage = GrepSettings.Instance; storage.Clear(); Assert.Empty(storage); storage["test"] = "hello"; storage.Save(destinationFolder + "\\test.xml"); Assert.True(File.Exists(destinationFolder + "\\test.xml")); Assert.True(new FileInfo(destinationFolder + "\\test.xml").Length > 10); }