public void Serialisation() { var queue = new LLQueue<int>(Enumerable.Range(0, 100)); using(MemoryStream ms = new MemoryStream()) { new BinaryFormatter().Serialize(ms, queue); ms.Flush(); ms.Seek(0, SeekOrigin.Begin); Assert.IsTrue(queue.ToList().SequenceEqual((LLQueue<int>)new BinaryFormatter().Deserialize(ms))); } }
public void Serialisation() { var queue = new LLQueue <int>(Enumerable.Range(0, 100)); using (MemoryStream ms = new MemoryStream()) { new BinaryFormatter().Serialize(ms, queue); ms.Flush(); ms.Seek(0, SeekOrigin.Begin); Assert.IsTrue(queue.ToList().SequenceEqual((LLQueue <int>) new BinaryFormatter().Deserialize(ms))); } }