예제 #1
0
파일: QueueTests.cs 프로젝트: kiszu/ForBlog
 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)));
     }
 }
예제 #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)));
            }
        }