public static void main(String[] args) {
PairSmokeTest test = new PairSmokeTest();
test.testConstruct();
test.testAccessors();
test.printSummary();
}
private void testConstruct() { header("Starting -- testConstruct"); //1-2-3 declare-construct-test Pair<Integer, Double> pair; pair = new Pair<>(0, 10.5); assertNotEquals(null, pair); }
private void testAccessors() { header("Starting -- testAccessors"); //Declare Pair<Employee, String> pair; int id = 1; Employee emp = new Employee(id, "Kofi Kingston"); //Construct pair = new Pair<>(emp, "08:30 AM"); //Test assertNotEquals(null, pair.getFirst()); assertNotEquals(null, pair.getSecond()); }
package pair.test; import pair.model.Pair; import testutil.AbstractTest; import testutil.Employee; public class PairSmokeTest extends AbstractTest { //-------------------------- //Main (Entry Point) public static void main(String[] args) { PairSmokeTest test = new PairSmokeTest(); test.testConstruct(); test.testAccessors(); test.printSummary(); } //-------------------------- //Tests private void testConstruct() { header("Starting -- testConstruct"); //1-2-3 declare-construct-test Pair<Integer, Double> pair; pair = new Pair<>(0, 10.5); assertNotEquals(null, pair); } private void testAccessors() { header("Starting -- testAccessors"); //Declare Pair<Employee, String> pair; int id = 1; Employee emp = new Employee(id, "Kofi Kingston"); //Construct pair = new Pair<>(emp, "08:30 AM"); //Test assertNotEquals(null, pair.getFirst()); assertNotEquals(null, pair.getSecond()); } }