public void Add_GivenData_ExpectsListWithHeadOnly () { //Given var expected = new linkList (); expected.Head = new Node { Data = 3 }; var ll = new linkList (); //When ll.Add (3); //Then ll.Should ().BeEquivalentTo (expected); }
public void TestName () { //Given var expected = new linkList(); expected.Head = new Node{Data = 3}; expected.Head.Next = new Node{Data = 5}; expected.Head.Next.Next = new Node{Data = 9}; expected.Head.Next.Next.Next = new Node{Data = 1}; expected.Head.Next.Next.Next.Next = new Node{Data = 2}; var ll = new linkList(); //When ll.Add(3); ll.Add(5); ll.Add(9); ll.Add(1); ll.Add(2); //Then ll.Should().BeEquivalentTo(expected); }