Пример #1
0
        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);
        }
Пример #2
0
        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");
        }
Пример #3
0
        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"));
        }
Пример #4
0
        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);
        }