public void ShouldGetElementByValidIndex(int[] arr, int index, int value) { OneWayList list = new OneWayList(arr); var expectedValue = list.GetElementByIndex(index); Assert.Equal(expectedValue, value); }
public void ListShouldBeConvertedToArray(int[] input) { OneWayList list = new OneWayList(input); var array = list.ConvertToArray(); Assert.Equal(input, array); }
public void ListShouldBeReversed(int[] input, int[] expected) { OneWayList list = new OneWayList(input); list.Reverse(); var array = list.ToArray(); Assert.Equal(expected, array); }
public void ShouldSetElementByUsingIndexing(int [] input, int index, int value, int [] expected) { OneWayList list = new OneWayList(input); list[index] = value; var array = list.ToArray(); Assert.Equal(expected, array); }
public void ShouldAddElementAtListAtSomePosition(int[] input, int index, int value, int[] expected) { OneWayList list = new OneWayList(input); list.AddAt(value, index); var array = list.ToArray(); Assert.Equal(expected, array); }
public void ShouldRemoveElementAtList(int[] input, int value, int[] expected) { OneWayList list = new OneWayList(input); list.Remove(value); var array = list.ToArray(); Assert.Equal(expected, array); }
public void ShouldRemoveElementAtListAtSomePosition(int[] input, int index, int[] expected) { OneWayList <int> list = new OneWayList <int>(input); list.RemoveAt(index); var array = list.ToArray(); Assert.Equal(expected, array); }
public void ListShouldBeSorted(int[] input, int[] expected) { OneWayList <int> list = new OneWayList <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 OneWayListEnumerator(OneWayList <TValue> .OneWayListNode <TValue> head) { _head = head; }