Ejemplo n.º 1
0
        public void RemoveValue_Expect_CountDecreasesBy1()
        {
            int valueToBeRemoved = 3;
            var linkedList       = new WsLinkedList();

            linkedList.InsertLast(2);
            linkedList.InsertLast(valueToBeRemoved);
            linkedList.Remove(valueToBeRemoved);

            Assert.Equal(1, linkedList.Count);
        }
Ejemplo n.º 2
0
        public void RemoveValue_Expect_ValueWasRemoved()
        {
            int valueToBeRemoved = 3;
            var linkedList       = new WsLinkedList();

            linkedList.InsertLast(2);
            linkedList.InsertLast(valueToBeRemoved);
            linkedList.Remove(valueToBeRemoved);

            var exists = linkedList.ToArray().Any(x => x == valueToBeRemoved);

            Assert.False(exists);
        }