public void SerializeDeserialize()
{
string storePath = PrepareTempStore("Store");
// serialize
var wsManager = new PalasoWritingSystemManager(new LocalFileWritingSystemStore(storePath));
var ws = wsManager.Set("en-US");
ws.SpellCheckingId = "en-US";
ws.MatchedPairs = "matched pairs";
ws.LCID = 0x409;
ws.ValidChars = "valid characters";
ws.LegacyMapping = "legacy mapping";
wsManager.Save();
// deserialize
wsManager = new PalasoWritingSystemManager(new LocalFileWritingSystemStore(storePath));
Assert.IsTrue(wsManager.Exists("en-US"));
ws = wsManager.Get("en-US");
Assert.AreEqual("Eng", ws.Abbreviation);
Assert.AreEqual("English", ws.LanguageSubtag.Name);
Assert.AreEqual("en-US", ws.SpellCheckingId);
Assert.AreEqual("United States", ws.RegionSubtag.Name);
Assert.AreEqual("matched pairs", ws.MatchedPairs);
Assert.AreEqual(0x409, ws.LCID);
Assert.AreEqual("valid characters", ws.ValidChars);
Assert.AreEqual("legacy mapping", ws.LegacyMapping);
Assert.AreEqual("eng", ws.ISO3);
wsManager.Save();
}