Esempio n. 1
0
        //-------------------------------------------------------------------------
        public virtual void test_combinedWith()
        {
            PointSensitivityBuilder @base = PointSensitivityBuilder.none();
            PointSensitivityBuilder ibor  = DummyPointSensitivity.of(GBP, date(2015, 6, 30), 2.0d);

            assertSame(@base.combinedWith(ibor), ibor);     // returns other
        }
Esempio n. 2
0
        public virtual void test_equalWithTolerance_true()
        {
            PointSensitivity   cs1b  = DummyPointSensitivity.of(GBP, date(2015, 6, 30), 12.1d);
            PointSensitivities test1 = PointSensitivities.of(Lists.newArrayList(CS3, CS1)).normalized();
            PointSensitivities test2 = PointSensitivities.of(Lists.newArrayList(CS3, cs1b)).normalized();

            assertTrue(test1.equalWithTolerance(test2, 1.0E-1));
        }
 public int compareKey(PointSensitivity other)
 {
     if (other is DummyPointSensitivity)
     {
         DummyPointSensitivity otherZero = (DummyPointSensitivity)other;
         return(ComparisonChain.start().compare(curveCurrency, otherZero.curveCurrency).compare(currency, otherZero.currency).compare(date, otherZero.date).result());
     }
     return(this.GetType().Name.CompareTo(other.GetType().Name));
 }
 //-----------------------------------------------------------------------
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         DummyPointSensitivity other = (DummyPointSensitivity)obj;
         return(JodaBeanUtils.equal(curveCurrency, other.curveCurrency) && JodaBeanUtils.equal(date, other.date) && JodaBeanUtils.equal(currency, other.currency) && JodaBeanUtils.equal(sensitivity, other.sensitivity));
     }
     return(false);
 }