BakeryPart2 { public static void main(String[] args) throws IOException { if (args[0] == null || args[0] == "") { System.out.println("File name expected as command line argument."); System.out.println("Program ending."); } else { String fileName = args[0]; BakedItemList a = new BakedItemList(); a.readItemFile(fileName); System.out.println(a.generateReport()); System.out.println(a.generateReportByClass()); System.out.println(a.generateReportByPrice()); System.out.println(a.generateReportByFlavor()); System.out.println(a.generateExcludedRecordsReport()); } }  static void main(String[] args);  }
@Test public void main1() throws Exception { BakeryPart2 app = new BakeryPart2(); String[] args = {null}; BakeryPart2.main(args); Assert.assertEquals(0, BakedItemList.getListCount()); }
@Test public void main2() throws Exception { BakeryPart2 app = new BakeryPart2(); String[] args = {"baked_item_data.csv"}; BakeryPart2.main(args); Assert.assertEquals(1, BakedItemList.getListCount()); }
@Test public void main3() throws Exception { BakeryPart2 app = new BakeryPart2(); String[] args = {""}; BakeryPart2.main(args); Assert.assertEquals(0, BakedItemList.getListCount()); }
@Test public void main4() throws Exception { BakeryPart2 app = new BakeryPart2(); String[] args = {null}; BakeryPart2.main(args); Assert.assertEquals(0, BakedItemList.getListCount()); }