Example #1
0
        //-------------------------------------------------------------------------
        public virtual void test_equals_hashCode()
        {
            Tenor a1 = TENOR_3D;
            Tenor a2 = Tenor.ofDays(3);
            Tenor b  = TENOR_4M;

            assertEquals(a1.Equals(a1), true);
            assertEquals(a1.Equals(b), false);
            assertEquals(a1.Equals(a2), true);

            assertEquals(a2.Equals(a1), true);
            assertEquals(a2.Equals(a2), true);
            assertEquals(a2.Equals(b), false);

            assertEquals(b.Equals(a1), false);
            assertEquals(b.Equals(a2), false);
            assertEquals(b.Equals(b), true);

            assertEquals(a1.GetHashCode(), a2.GetHashCode());
        }