public static void main(String[] args) {
TaxCalculatorSmokeTest test = new TaxCalculatorSmokeTest();
test.testConstruct();
test.testCalculate();
test.printSummary();
}
private void testConstruct() { header("Starting -- testConstruct"); //Declare Car car; TaxCalculator calc; car = new Car("Toyota", "Corolla", "10000"); //Construct calc = new TaxCalculator(car, "0.05"); //Test assertNotEquals(null, calc); }
private void testCalculate() { header("Starting -- testUsingLunch"); //Declare Lunch lunch; TaxCalculator calc; lunch = new Lunch("All you can eat Tacos", "10"); //Construct calc = new TaxCalculator(lunch, "0.07"); //Execute calc.calculate(); //Test //If we get here (did not hit exception) we pass assertTrue(true); }
package taxcalc.test; import taxcalc.model.TaxCalculator; import testutil.AbstractTest; public class TaxCalculatorSmokeTest extends AbstractTest { //-------------------------- //Main (Entry Point) public static void main(String[] args) { TaxCalculatorSmokeTest test = new TaxCalculatorSmokeTest(); test.testConstruct(); test.testCalculate(); test.printSummary(); } //-------------------------- //Tests private void testConstruct() { header("Starting -- testConstruct"); //Declare Car car; TaxCalculator calc; car = new Car("Toyota", "Corolla", "10000"); //Construct calc = new TaxCalculator(car, "0.05"); //Test assertNotEquals(null, calc); } private void testCalculate() { header("Starting -- testUsingLunch"); //Declare Lunch lunch; TaxCalculator calc; lunch = new Lunch("All you can eat Tacos", "10"); //Construct calc = new TaxCalculator(lunch, "0.07"); //Execute calc.calculate(); //Test //If we get here (did not hit exception) we pass assertTrue(true); } }