public void Reverse(int length)
 {
     var values = Enumerable.Range(1, length).ToArray();
     var list = new SimpleLinkedList<int>(values);
     var reversed = list.Reverse();
     Assert.That(reversed, Is.EqualTo(values.Reverse()));
 }
    public void Reverse(int length)
    {
        var values   = Enumerable.Range(1, length).ToArray();
        var list     = new SimpleLinkedList <int>(values);
        var reversed = list.Reverse();

        Assert.That(reversed, Is.EqualTo(values.Reverse()));
    }
        public void Reverse_ShouldReverse_TheElementsInLinkedList(int[] numbers)
        {
            // Arrange
            var linkedList     = new SimpleLinkedList(numbers[0]);
            var reverseNumbers = numbers.Reverse();

            // Act
            for (var i = 1; i < numbers.Length; i++)
            {
                linkedList.AddAfter(numbers[i]);
            }

            linkedList.Reverse();
            var linkedListElements = linkedList.GetElements();

            // Assert
            linkedListElements.ToArray().Should().BeEquivalentTo(reverseNumbers);
        }