Beispiel #1
0
        //-------------------------------------------------------------------------
        public virtual void test_compareKey()
        {
            FxIndexSensitivity  a1    = FxIndexSensitivity.of(GBP_USD_WM_OBS, GBP, USD, SENSITIVITY_VALUE);
            FxIndexSensitivity  a2    = FxIndexSensitivity.of(GBP_USD_WM_OBS, GBP, USD, SENSITIVITY_VALUE);
            FxIndexSensitivity  b     = FxIndexSensitivity.of(EUR_GBP_ECB_OBS, USD, SENSITIVITY_VALUE);
            FxIndexSensitivity  c     = FxIndexSensitivity.of(GBP_USD_WM_OBS, USD, GBP, SENSITIVITY_VALUE);
            FxIndexSensitivity  d     = FxIndexSensitivity.of(GBP_USD_WM_OBS, USD, JPY, SENSITIVITY_VALUE);
            FxIndexSensitivity  e     = FxIndexSensitivity.of(GBP_USD_WM_OBS2, USD, SENSITIVITY_VALUE);
            ZeroRateSensitivity other = ZeroRateSensitivity.of(GBP, 2d, SENSITIVITY_VALUE);

            assertEquals(a1.compareKey(a2), 0);
            assertEquals(a1.compareKey(b) > 0, true);
            assertEquals(b.compareKey(a1) < 0, true);
            assertEquals(a1.compareKey(c) > 0, true);
            assertEquals(c.compareKey(a1) < 0, true);
            assertEquals(a1.compareKey(d) > 0, true);
            assertEquals(d.compareKey(a1) < 0, true);
            assertEquals(a1.compareKey(e) > 0, true);
            assertEquals(e.compareKey(a1) < 0, true);
            assertEquals(a1.compareKey(other) < 0, true);
            assertEquals(other.compareKey(a1) > 0, true);
        }