package com.mijecu25.dsa;

import org.junit.Assert;
import org.junit.Test;

/**
 * This is the Node test class. 
 * 
 * @author Miguel Velez
 * @version 0.2.1
 *  
 */
public class TestNode {
	Node node = new Node(6, null);
	
	/**
	 * Test the node constructor.
	 */
	@Test
	public void TestNodeConstructor() {		
		// Check if they are the same class
		Assert.assertSame(Node.class, this.node.getClass()); 
		
		// Check if they are the same class
		Assert.assertNotSame(String.class, this.node.getClass()); 
	}
	
	/**
	 * Test the get data method.
	 */
	@Test
	public void TestGetData() {		
		// Checking if we get the same data back
		Assert.assertEquals(6, this.node.getData());
		
		// Check if we do not get the same data back
		Assert.assertNotEquals(5, this.node.getData());
	}

}

@@ -152,11 +152,9 @@
 n 0.
-2.1
+3
 %0A * 
@@ -189,20 +189,55 @@
 %7B%0A%09Node 
-node
+first = new Node(6, null);%0A%09Node second
  = new N
@@ -232,33 +232,37 @@
 cond = new Node(
-6
+%22Dog%22
 , null);%0A%09%0A%09/**%0A
@@ -410,36 +410,37 @@
 ode.class, this.
-node
+first
 .getClass()); %0A%09
@@ -517,28 +517,29 @@
 class, this.
-node
+first
 .getClass())
@@ -693,28 +693,29 @@
 als(6, this.
-node
+first
 .getData());
@@ -802,20 +802,369 @@
 his.
-node.getData
+first.getData());%0A%09%7D%0A%09%0A%09/**%0A%09 * Test the get next method%0A%09 */%0A%09@Test%0A%09public void TestSetGetNext() %7B%0A%09%09// Set second as first's next%0A%09%09first.setNext(second);%0A%09%09%0A%09%09// Check if the next node is the second node%0A%09%09Assert.assertEquals(second, first.getNext());%0A%09%09%0A%09%09// Check if that the next node of second is not first%0A%09%09Assert.assertNotEquals(first, second.getNext
 ());

Test get and set next node