예제 #1
0
        public void AddMany()
        {
            Deque <string> deque1 = new Deque <string>(new string[] { "A", "B", "C", "D" });

            deque1.AddManyToFront(new string[] { "Q", "R", "S" });
            deque1.AddManyToBack(new string[] { "L", "M", "N", "O" });
            InterfaceTests.TestReadWriteListGeneric(deque1, new string[] { "Q", "R", "S", "A", "B", "C", "D", "L", "M", "N", "O" });
        }
예제 #2
0
        public void SerializeStrings()
        {
            Deque <string> d = new Deque <string>();

            d.AddToFront("foo");
            d.AddToBack("world");
            d.AddToFront("hello");
            d.AddToBack("elvis");
            d.AddToFront("elvis");
            d.AddToBack(null);
            d.AddToFront("cool");
            d.AddManyToFront(new string[] { "1", "2", "3", "4", "5", "6" });
            d.AddManyToBack(new string[] { "7", "8", "9", "10", "11", "12" });

            Deque <string> result = (Deque <string>)InterfaceTests.SerializeRoundTrip(d);

            InterfaceTests.TestReadWriteListGeneric((IList <string>)result, new string[] { "1", "2", "3", "4", "5", "6", "cool", "elvis", "hello", "foo", "world", "elvis", null, "7", "8", "9", "10", "11", "12" });
        }