Exemple #1
0
        /* FIXME: disabled pending fix for #75299
         * [Test]
         */
        public void EnumeratorSerializationTest()
        {
            BinaryFormatter formatter = new BinaryFormatter();
            MemoryStream    stream    = new MemoryStream();

            CircularLinkedList <int> .Enumerator e = threeList.GetEnumerator();
            formatter.Serialize(stream, e);

            stream.Position = 0;
            object deserialized = formatter.Deserialize(stream);

            Assert.IsTrue(deserialized is CircularLinkedList <int> .Enumerator);

            CircularLinkedList <int> .Enumerator d = (CircularLinkedList <int> .Enumerator)deserialized;

            int[] values = { 2, 3, 4 };
            int   i      = 0;

            while (d.MoveNext())
            {
                Assert.AreEqual(values[i], d.Current);
                i++;
            }
            Assert.AreEqual(3, i);
        }