Exemple #1
0
        public void Should_delete_a_node_when_indice_is_specified_in_the_end_of_list()
        {
            var linkedList = new LinkedListGeneric <string>();

            linkedList.Add("A");
            linkedList.Add("B");
            linkedList.Add("C");
            linkedList.Add("D");
            linkedList.Delete(3);
            var size = linkedList.Size();

            Check.That(size).IsEqualTo(3);
            Check.That(linkedList.Get(2)).IsEqualTo("C");
        }
Exemple #2
0
        public void Should_delete_a_node_when_indice_is_specified_in_the_begining_of_list()
        {
            var linkedList = new LinkedListGeneric <string>();

            linkedList.Add("ZAZAZ");
            linkedList.Add("AZAZA");
            linkedList.Add("AZAZA1");
            linkedList.Add("AZAZA2");
            linkedList.Delete(0);
            var size = linkedList.Size();

            Check.That(size).IsEqualTo(3);
            Check.That(linkedList.Get(0)).IsEqualTo("AZAZA");
        }