import junit.framework.TestCase;

/**
 * A JUnit test case class.
 * Every method starting with the word "test" will be called when running
 * the test with JUnit.
 */
public class ChapterTester extends TestCase {
    
    /** You don't have to put specs on procedures here */
    public void testGetters() {
        Chapter c1= new Chapter("Intro", 1, null);
        assertEquals( "Intro",  c1.getTitle());
        assertEquals( 1, c1.getNumber());
        assertEquals( null , c1.getPrevious());
        
        Chapter c2= new Chapter("Truth and Love", 2, c1);
        assertEquals( "Truth and Love",  c2.getTitle());
        assertEquals( 2, c2.getNumber());
        assertEquals( c1 , c2.getPrevious());
    }
    
    /** You don't have to put specs on procedures here */
    public void testSetters() {
        Chapter c1= new Chapter("Intro", 1, null);
        c1.setTitle("Introduction");
        assertEquals( "Introduction",  c1.getTitle());
        
        c1. setNumber(0);
        assertEquals( 0, c1.getNumber());
        
        Chapter c2= new Chapter("Truth and Love", 2, null);
        c2.setPrevious(c1);
        assertEquals(c1 , c2.getPrevious());
    }
    
}
