示例#1
0
 public virtual 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);
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Converts pay/receive to a string.
 /// </summary>
 /// <param name="payReceive">  the value </param>
 /// <returns> the string form </returns>
 public static string payReceive(PayReceive payReceive)
 {
     return(payReceive.ToString().Substring(0, 3));
 }
示例#3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "name") public void test_of_lookupUpperCase(PayReceive convention, String name)
        public virtual void test_of_lookupUpperCase(PayReceive convention, string name)
        {
            assertEquals(PayReceive.of(name.ToUpper(Locale.ENGLISH)), convention);
        }
示例#4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "name") public void test_of_lookup(PayReceive convention, String name)
        public virtual void test_of_lookup(PayReceive convention, string name)
        {
            assertEquals(PayReceive.of(name), convention);
        }
示例#5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "name") public void test_toString(PayReceive convention, String name)
        public virtual void test_toString(PayReceive convention, string name)
        {
            assertEquals(convention.ToString(), name);
        }
示例#6
0
 //-------------------------------------------------------------------------
 public virtual void test_ofPay()
 {
     assertEquals(PayReceive.ofPay(true), PayReceive.PAY);
     assertEquals(PayReceive.ofPay(false), PayReceive.RECEIVE);
 }
示例#7
0
 public virtual void test_of_lookup_null()
 {
     assertThrowsIllegalArg(() => PayReceive.of(null));
 }
示例#8
0
 public virtual void test_of_lookup_notFound()
 {
     assertThrowsIllegalArg(() => PayReceive.of("Rubbish"));
 }