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)); }
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); }
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); }