public void AddMethodShouldAddElementCorrectly()
        {
            var list = new CustomDoubleLinkedList <int>();

            list.Add(1);
            list.Add(4);
            list.Add(6);
            Assert.Equal(3, list.Count);
        }
        public void ContainsMethodShouldReturnTrueIfElementExistsInList()
        {
            var list = new CustomDoubleLinkedList <int>();

            list.Add(1);
            list.Add(4);
            list.Add(6);

            Assert.True(list.Contains(4));
        }
        public void RemoveMethodShouldWorkCorrectly()
        {
            var list = new CustomDoubleLinkedList <int>();

            list.Add(1);
            list.Add(4);
            list.Add(6);
            list.Remove(4);
            Assert.Equal(2, list.Count);
        }
        public void SwapShouldWorkCorrectlyForFirstAndLastElementsInList()
        {
            var list = new CustomDoubleLinkedList <int>();

            list.Add(1);
            list.Add(5);
            list.Swap(1, 5);

            Assert.Equal(5, list.First);
            Assert.Equal(1, list.Last);
        }
        public void SwapShouldWorkCorrectlyForNearbyElements()
        {
            var list = new CustomDoubleLinkedList <int>();

            list.Add(1);
            list.Add(2);
            list.Add(3);
            list.Add(4);
            list.Add(5);
            list.Swap(4, 5);

            Assert.Equal(4, list.Last);
        }
        public void SwapShouldWorkCorrectlyForLastElementAndElementInTheMiddle()
        {
            var list = new CustomDoubleLinkedList <int>();

            list.Add(1);
            list.Add(2);
            list.Add(3);
            list.Add(4);
            list.Add(5);
            list.Swap(3, 5);

            Assert.Equal(1, list.First);
            Assert.Equal(3, list.Last);
        }