Example #1
0
        public void ConvertAll()
        {
            var deque     = new Deque <int>(new[] { 1, 2, 3, 4 });
            var deque_str = deque.ConvertAll(_ => _ + "");

            Assert.Equal(4, deque_str.Count);
            Assert.Equal(new[] { "1", "2", "3", "4" }, deque_str);

            deque = new Deque <int>(new[] { 1, 2, 3, 4 });
            Assert.Equal(4, deque.RemoveFromBack());
            deque.AddToFront(0);
            Assert.True(deque.IsSplit);
            deque_str = deque.ConvertAll(_ => _ + "");
            Assert.Equal(4, deque_str.Count);
            Assert.Equal(new[] { "0", "1", "2", "3" }, deque_str);
        }