@Test public void testValidatingAmount() { AwardApprovedEquipment equipmentItem = createEquipmentItem(VENDOR, MODEL, WIDGET1, -1.00); checkValidAmount(equipmentItem, 1); equipmentItem.setAmount(0.00); checkValidAmount(equipmentItem, 1); equipmentItem.setAmount(AMOUNT2 - ONE_PENNY); checkValidAmount(equipmentItem, 1); equipmentItem.setAmount(AMOUNT2); checkValidAmount(equipmentItem, 1); equipmentItem.setAmount(null); checkValidAmount(equipmentItem, 1); }
@Test public void testRequiredFieldPresent() { AwardApprovedEquipment equipmentItem = createEquipmentItem(VENDOR, MODEL, WIDGET1, AMOUNT1); Assert.assertTrue(approvedEquipmentRule.areRequiredFieldsComplete(equipmentItem)); equipmentItem.setVendor(null); Assert.assertTrue(approvedEquipmentRule.areRequiredFieldsComplete(equipmentItem)); equipmentItem.setModel(null); Assert.assertTrue(approvedEquipmentRule.areRequiredFieldsComplete(equipmentItem)); equipmentItem.setItem(null); Assert.assertFalse(approvedEquipmentRule.areRequiredFieldsComplete(equipmentItem)); equipmentItem.setItem(WIDGET1); equipmentItem.setAmount(null); Assert.assertFalse(approvedEquipmentRule.areRequiredFieldsComplete(equipmentItem)); }