Example #1
0
 public void test_ofSignedAmount() {
   assertEquals(PayReceive.ofSignedAmount(-1d), PayReceive.PAY);
   assertEquals(PayReceive.ofSignedAmount(-0d), PayReceive.PAY);
   assertEquals(PayReceive.ofSignedAmount(0d), PayReceive.RECEIVE);
   assertEquals(PayReceive.ofSignedAmount(+0d), PayReceive.RECEIVE);
   assertEquals(PayReceive.ofSignedAmount(1d), PayReceive.RECEIVE);
 }
Example #2
0
 public void test_of_lookup_null() {
   assertThrowsIllegalArg(() -> PayReceive.of(null));
 }
Example #3
0
 public void test_of_lookup_notFound() {
   assertThrowsIllegalArg(() -> PayReceive.of("Rubbish"));
 }
Example #4
0
 @Test(dataProvider = "name")
 public void test_of_lookup(PayReceive convention, String name) {
   assertEquals(PayReceive.of(name), convention);
 }
Example #5
0
 @Test(dataProvider = "name")
 public void test_toString(PayReceive convention, String name) {
   assertEquals(convention.toString(), name);
 }
Example #6
0
 // -------------------------------------------------------------------------
 public void test_ofPay() {
   assertEquals(PayReceive.ofPay(true), PayReceive.PAY);
   assertEquals(PayReceive.ofPay(false), PayReceive.RECEIVE);
 }