public void TestReadInMemory() { var serializer = new LanguagePackSerializer(); LanguagePack dictionary = new LanguagePack(description, languageDictionary); LanguagePack splitDictionary = new LanguagePack(description, languageSplitDictionary); using (Stream stream = new MemoryStream()) { serializer.Serialize(stream, dictionary); stream.Seek(0, SeekOrigin.Begin); var pack = serializer.DeserializeSplit(stream); CheckIsSame(dictionary, pack); } using (Stream stream = new MemoryStream()) { serializer.Serialize(stream, splitDictionary); stream.Seek(0, SeekOrigin.Begin); var pack = serializer.DeserializePack(stream); CheckIsSame(splitDictionary, pack); } }
private void ReadWriteTest(Stream stream, LanguagePack pack1) { var serializer = new LanguagePackSerializer(); serializer.Serialize(stream, pack1); stream.Seek(0, SeekOrigin.Begin); ReadTest(stream, pack1); }