//-------------------------------------------------------------------------
        public virtual void coverage()
        {
            SimpleConstantContinuousBarrier test1 = SimpleConstantContinuousBarrier.of(BarrierType.DOWN, KnockType.KNOCK_IN, 1.5);
            SimpleConstantContinuousBarrier test2 = SimpleConstantContinuousBarrier.of(BarrierType.UP, KnockType.KNOCK_OUT, 2.1);

            coverImmutableBean(test1);
            coverBeanEquals(test1, test2);
        }
        public virtual void test_of()
        {
            double level = 1.5;
            SimpleConstantContinuousBarrier test = SimpleConstantContinuousBarrier.of(BarrierType.DOWN, KnockType.KNOCK_IN, level);

            assertEquals(test.BarrierLevel, level);
            assertEquals(test.getBarrierLevel(LocalDate.of(2015, 1, 21)), level);
            assertEquals(test.BarrierType, BarrierType.DOWN);
            assertEquals(test.KnockType, KnockType.KNOCK_IN);
        }
        public virtual void test_inverseKnockType()
        {
            double level = 1.5;
            SimpleConstantContinuousBarrier @base    = SimpleConstantContinuousBarrier.of(BarrierType.DOWN, KnockType.KNOCK_IN, level);
            SimpleConstantContinuousBarrier test     = @base.inverseKnockType();
            SimpleConstantContinuousBarrier expected = SimpleConstantContinuousBarrier.of(BarrierType.DOWN, KnockType.KNOCK_OUT, level);

            assertEquals(test, expected);
            assertEquals(test.inverseKnockType(), @base);
        }
예제 #4
0
 //-----------------------------------------------------------------------
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         SimpleConstantContinuousBarrier other = (SimpleConstantContinuousBarrier)obj;
         return(JodaBeanUtils.equal(barrierType, other.barrierType) && JodaBeanUtils.equal(knockType, other.knockType) && JodaBeanUtils.equal(barrierLevel, other.barrierLevel));
     }
     return(false);
 }
        public virtual void test_serialization()
        {
            SimpleConstantContinuousBarrier test = SimpleConstantContinuousBarrier.of(BarrierType.DOWN, KnockType.KNOCK_IN, 1.5);

            assertSerialization(test);
        }