Esempio n. 1
0
        public void WriteYamlFileTest()
        {
            FooSettings foo = new FooSettings()
            {
                Foo = 10, Bar = 20
            };
            IFileIO writer = new YamlFileIO();

            writer.Write(typeof(FooSettings), foo, FoobarPath.FilePath);

            Assert.AreEqual(true, File.Exists(FoobarPath.FilePath));
        }
Esempio n. 2
0
        public void ElementRemoved()
        {
            YamlFileIO file = new YamlFileIO(AssertExceptionFail);
            var        data = file.Read(typeof(ThemeRemoved), TestPath.FilePath) as ThemeRemoved;

            data.ItemsCountPerPage = 88;
            file.Write(typeof(ThemeRemoved), data, TestPath.FilePath);

            var newData = file.Read(typeof(ThemeRemoved), TestPath.FilePath) as ThemeRemoved;

            Assert.AreEqual(true, newData.UseMigemo);
            Assert.AreEqual(88, newData.ItemsCountPerPage);
        }
Esempio n. 3
0
        public void ElementAdded()
        {
            YamlFileIO file = new YamlFileIO(AssertExceptionFail);
            var        data = file.Read(typeof(TestStorage), TestPath.FilePath) as TestStorage;

            data.Theme = "Added";
            file.Write(typeof(TestStorage), data, TestPath.FilePath);

            var newData = file.Read(typeof(TestStorage), TestPath.FilePath) as TestStorage;

            Assert.AreEqual("Added", newData.Theme);
            Assert.AreEqual(88, newData.ItemsCountPerPage);
            Assert.AreEqual(true, newData.UseMigemo);
        }