// SectionTest.java  P. Conrad, for CISC370, 06/18/2007
//   based on p. 231 from Java Cookbook, 2nd Edition (O'Reilly)

import junit.framework.TestCase;


/**
 * Unit tests for the {@link Section} class.
 * @author Phill Conrad
 */

public class SectionTest extends TestCase {

    /**
     * A unit test to test the constructors and the getters
     * A more "pure" approach would factor this into multiple tests.
     * What are the pros/cons of doing that?
     */

    public void testConstructorAndGetters() {


	Section s1 = new Section("Section 1.1",
				 "My First Section", 
				 "2",
				 "hfjava2-CHP-1-SECT-1");

	Section s2 = new Section("Section 1.2",
				 "The Next Section", 
				 "6",
				 "hfjava2-CHP-1-SECT-2");

	// test two instances to make sure we really
	// have two separate instances

	assertEquals("Section 1.1",s1.getName());
	assertEquals("My First Section",s1.getTitle());
	assertEquals("2",s1.getPage());
	assertEquals("hfjava2-CHP-1-SECT-1",s1.getSafari());

	assertEquals("Section 1.2",s2.getName());
	assertEquals("The Next Section",s2.getTitle());
	assertEquals("6",s2.getPage());
	assertEquals("hfjava2-CHP-1-SECT-2",s2.getSafari());



    }


} // class
