public void AtListWithALotElementsExecuteValuesReturnArrayElements()
        {
            var list = new KLList();

            list.Add("fred");
            list.Add("wilma");
            list.Add("betty");
            list.Add("barney");

            Assert.AreEqual(new[] {"fred", "wilma", "betty", "barney"}, list.Values());
        }
        public void AtListExecuteValuesReturnArrayElements()
        {
            var list = new KLList();

            list.Add("fred");
            list.Add("wilma");

            Assert.AreEqual("fred", list.Find ("fred").Value);
            Assert.AreEqual("wilma", list.Find ("wilma").Value);
            Assert.AreEqual(new[] {"fred", "wilma"}, list.Values());
        }
        public void DeleteAllNodes()
        {
            var list = new KLList();

            list.Add("fred");
            list.Add("wilma");
            list.Add("betty");
            list.Add("barney");

            list.Delete(list.Find("wilma"));
            list.Delete(list.Find("barney"));
            list.Delete(list.Find("fred"));
            list.Delete(list.Find("betty"));

            Assert.AreEqual(new string[] { }, list.Values());
        }
        public void DeleteNodesWilmaAndBarney()
        {
            var list = new KLList();

            list.Add("fred");
            list.Add("wilma");
            list.Add("betty");
            list.Add("barney");

            list.Delete(list.Find("wilma"));
            list.Delete(list.Find("barney"));

            Assert.AreEqual(new[] {"fred", "betty"}, list.Values());
        }
        public void DeleteNodeNullThrowAssert()
        {
            var list = new KLList();

            list.Add("fred");
            list.Add("wilma");
            list.Add("betty");
            list.Add("barney");

            Assert.Throws<NullReferenceException>(() => list.Delete(null));

            Assert.AreEqual(new[] {"fred", "wilma", "betty", "barney"}, list.Values());
        }