import org.junit.Test; import static org.junit.Assert.assertEquals; /** * The test class StudentTest -- it tests the Student class * * @author Phill Conrad, and (insert your name here) * @version lab04 for CS56, Winter 2011 * @see Student */ public class BooleanExpressionTest { @Test public void testBooleanLiteral() { // set up a student with the constructor, and // then make sure that the getters retrieve the // values that we expect the new object to have BooleanLiteral bl = new BooleanLiteral(true); assertEquals(true,bl..getName()); assertEquals(1234567,s.getPermNumber()); } @Test public void testConstructorSetAndGetName() { // set up a student with the constructor, set // the values to something else, then then // see if the values are what we expect them to be. Student s = new Student("Chris Jones",9999999); s.setName("Fred Smith"); assertEquals("Fred Smith",s.getName()); } @Test public void testConstructorSetAndGetPermNumber() { // set up a student with the constructor, set // the values to something else, then then // see if the values are what we expect them to be. Student s = new Student("Chris Jones",9999999); s.setPermNumber(1234567); assertEquals(1234567,s.getPermNumber()); } @Test public void testToString() { // set up a student with the constructor, // and see if the toString method returns what // we expect to see Student s = new Student("Chris Jones",9999999); assertEquals("(name: Chris Jones, perm: 9999999)", s.toString()); } }