Example #1
0
        public void TestSetFirst_Throws_Exception_When_Size_0()
        {
            LinkedList <Employee> linkedList = new LinkedList <Employee>();
            Employee emp1 = new Employee(1);

            Assert.That(() => linkedList.SetFirst(emp1), Throws.Exception.TypeOf <IndexOutOfRangeException>());
        }
Example #2
0
        public void TestSetFirst_Success()
        {
            LinkedList <Employee> linkedList = new LinkedList <Employee>();
            Employee emp1 = new Employee(1);
            Employee emp2 = new Employee(2);

            linkedList.InsertData(emp1);

            linkedList.SetFirst(emp2);
            Assert.That(linkedList.GetFirst(), Is.EqualTo(emp2));
        }