Esempio n. 1
0
 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)));
     }
 }
Esempio n. 2
0
        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)));
            }
        }