コード例 #1
0
 /** Test of giveAmountToPay method, of class PointOfSaleTerminalImpl. */
 @Test
 public void testGiveAmountToPay_CCCCCCC() {
   terminal.clearScanned();
   try {
     for (int i = 1; i <= 7; i++) {
       terminal.scan("C");
     }
     assertEquals(new BigDecimal(6.00), terminal.giveAmountToPay());
   } catch (ProductNotFoundException ex) {
     fail(ex.getMessage());
   }
 }
コード例 #2
0
 /** Test of giveAmountToPay method, of class PointOfSaleTerminalImpl. */
 @Test
 public void testGiveAmountToPay_ABCD() {
   terminal.clearScanned();
   try {
     terminal.scan("A");
     terminal.scan("B");
     terminal.scan("C");
     terminal.scan("D");
     assertEquals(new BigDecimal(7.25), terminal.giveAmountToPay());
   } catch (ProductNotFoundException ex) {
     fail(ex.getMessage());
   }
 }
コード例 #3
0
 /** Test of scan method, of class PointOfSaleTerminalImpl. */
 @Test(expected = ProductNotFoundException.class)
 public void testScan_ProductNotFoundException() throws ProductNotFoundException {
   terminal.clearScanned();
   terminal.scan("G");
 }
コード例 #4
0
 /** Test of giveAmountToPay method, of class PointOfSaleTerminalImpl. */
 @Test
 public void testGiveAmountToPay_NotScannedProduct() {
   assertEquals(new BigDecimal(0.00), terminal.giveAmountToPay());
 }