Esempio n. 1
0
        //-------------------------------------------------------------------------
        public virtual void test_equals_hashCode()
        {
            CurrencyAmount other = CurrencyAmount.of(CCY1, AMT1);

            assertTrue(CCY_AMOUNT.Equals(CCY_AMOUNT));
            assertTrue(CCY_AMOUNT.Equals(other));
            assertTrue(other.Equals(CCY_AMOUNT));
            assertEquals(CCY_AMOUNT.GetHashCode(), other.GetHashCode());
            other = CurrencyAmount.of(CCY1, AMT1);
            assertEquals(CCY_AMOUNT, other);
            assertEquals(CCY_AMOUNT.GetHashCode(), other.GetHashCode());
            other = CurrencyAmount.of(CCY2, AMT1);
            assertFalse(CCY_AMOUNT.Equals(other));
            other = CurrencyAmount.of(CCY1, AMT2);
            assertFalse(CCY_AMOUNT.Equals(other));
        }