public void TestSetData()
        {
            Employee        emp1  = new Employee(1);
            Node <Employee> node1 = new Node <Employee>();

            node1.SetData(emp1);
            Assert.That(node1.GetData(), Is.EqualTo(emp1));
        }
Example #2
0
        /// <summary>
        /// Change the supplied node's data to the data value passed
        /// </summary>
        /// <param name="newData">The new data to set</param>
        /// <param name="node">The node to have its data replaced</param>
        /// <returns>The old data from the node</returns>
        private T SetData(T newData, Node <T> node)
        {
            T oldData = node.GetData();

            node.SetData(newData);

            return(oldData);
        }