Example #1
0
        public void Init()
        {
            var nextNode = new Node(24);
            var node     = new Node(12);

            node.AddNextNode(nextNode);
            linked = new LinkedListCustom(node);
        }
Example #2
0
        public void Should_parcour_list_when_nodes_added()
        {
            var nextNode = new Node(24);
            var node     = new Node(12);

            node.AddNextNode(nextNode);
            var    linked           = new LinkedListCustom(node);
            var    contentsExpected = $"12-24";
            string contents         = linked.GetAllNodesContents();

            Check.That(contents).IsEqualTo(contentsExpected);
        }
Example #3
0
        public void Should_throw_an_exception_when_node_null_added()
        {
            var linked = new LinkedListCustom(null);

            Check.ThatCode(() => linked.GetAllNodesContents()).Throws <Exception>();
        }