public void ShouldGetElementByValidIndex(int[] arr, int index, int value)
        {
            TwoWayList <int> list = new TwoWayList <int>(arr);
            var expectedValue     = list.GetElementByIndex(index);

            Assert.Equal(expectedValue, value);
        }
        public void ShouldGetElementByUsingIndexing(int[] input, int index, int value)
        {
            TwoWayList <int> list = new TwoWayList <int>(input);
            var expectedValue     = list[index];

            Assert.Equal(expectedValue, value);
        }
        public void ListShouldBeConvertedToArray(int[] input)
        {
            TwoWayList <int> list = new TwoWayList <int>(input);
            var array             = list.ConvertToArray();

            Assert.Equal(input, array);
        }
        public void ShouldSetElementByUsingIndexing(int[] input, int index, int value, int[] expected)
        {
            TwoWayList <int> list = new TwoWayList <int>(input);

            list[index] = value;
            var array = list.ToArray();

            Assert.Equal(expected, array);
        }
        public void ShouldAddElementAtListAtSomePosition(int[] input, int index, int value, int[] expected)
        {
            TwoWayList <int> list = new TwoWayList <int>(input);

            list.AddAt(value, index);
            var array = list.ToArray();

            Assert.Equal(expected, array);
        }
        public void ShouldRemoveElementAtList(int[] input, int value, int[] expected)
        {
            TwoWayList <int> list = new TwoWayList <int>(input);

            list.Remove(value);
            var array = list.ToArray();

            Assert.Equal(expected, array);
        }
        public void ListShouldBeSorted(int[] input, int[] expected)
        {
            TwoWayList <int> list = new TwoWayList <int>(input);

            list.Sort();
            var array = list.ToArray();

            Assert.Equal(expected, array);
        }
            public bool MoveNext()
            {
                if (_current == null)
                {
                    if (_head == null)
                    {
                        return(false);
                    }

                    _current = _head;
                    return(true);
                }
                else
                {
                    if (_current.Next == null)
                    {
                        return(false);
                    }

                    _current = _current.Next;
                    return(true);
                }
            }
 public void Reset()
 {
     _current = null;
 }
 public TwoWayListEnumerator(TwoWayList <TValue> .TwoWayListNode <TValue> head)
 {
     _head = head;
 }