예제 #1
0
파일: StorageTest.cs 프로젝트: zer/dnGrep
        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");
        }
예제 #2
0
파일: StorageTest.cs 프로젝트: zer/dnGrep
        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"));
        }
예제 #3
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);
        }