public static void main(String[] args) {
AssociationSmokeTest test = new AssociationSmokeTest();
test.testConstruct();
test.testAccessors();
test.printSummary();
}
private void testConstruct() { header("Starting -- testConstruct"); //Declare Association<String, Integer> assoc; String key = "A"; Integer value = 10; //Construct assoc = new Association<>(key, value); //Test assertNotEquals(null, assoc); }
private void testAccessors() { header("Starting -- testAccessors"); //Declare Association<Integer, Employee> assoc; int id = 1; Employee emp = new Employee(id, "Kofi Kingston"); //Construct assoc = new Association<>(id, emp); //Test assertNotEquals(null, assoc.getKey()); assertNotEquals(null, assoc.getValue()); }
package assoc.test; import java.util.Arrays; import java.util.List; import assoc.model.Association; import testutil.AbstractTest; import testutil.Employee; public class AssociationSmokeTest extends AbstractTest { //-------------------------- //Main (Entry Point) public static void main(String[] args) { AssociationSmokeTest test = new AssociationSmokeTest(); test.testConstruct(); test.testAccessors(); test.printSummary(); } //-------------------------- //Tests private void testConstruct() { header("Starting -- testConstruct"); //Declare Association<String, Integer> assoc; String key = "A"; Integer value = 10; //Construct assoc = new Association<>(key, value); //Test assertNotEquals(null, assoc); } private void testAccessors() { header("Starting -- testAccessors"); //Declare Association<Integer, Employee> assoc; int id = 1; Employee emp = new Employee(id, "Kofi Kingston"); //Construct assoc = new Association<>(id, emp); //Test assertNotEquals(null, assoc.getKey()); assertNotEquals(null, assoc.getValue()); } }