예제 #1
0
 private SimpleConstantContinuousBarrier(BarrierType barrierType, KnockType knockType, double barrierLevel)
 {
     JodaBeanUtils.notNull(barrierType, "barrierType");
     JodaBeanUtils.notNull(knockType, "knockType");
     this.barrierType  = barrierType;
     this.knockType    = knockType;
     this.barrierLevel = barrierLevel;
 }
예제 #2
0
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 1029043089:         // barrierType
                    this.barrierType = (BarrierType)newValue;
                    break;

                case 975895086:         // knockType
                    this.knockType = (KnockType)newValue;
                    break;

                case 1827586573:         // barrierLevel
                    this.barrierLevel = (double?)newValue.Value;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
예제 #3
0
 public virtual void test_of_lookup_null()
 {
     assertThrowsIllegalArg(() => KnockType.of(null));
 }
예제 #4
0
 public virtual void test_of_lookup_notFound()
 {
     assertThrowsIllegalArg(() => KnockType.of("Rubbish"));
 }
예제 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "name") public void test_of_lookup(KnockType type, String name)
        public virtual void test_of_lookup(KnockType type, string name)
        {
            assertEquals(KnockType.of(name), type);
        }
예제 #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "name") public void test_toString(KnockType type, String name)
        public virtual void test_toString(KnockType type, string name)
        {
            assertEquals(type.ToString(), name);
        }
예제 #7
0
        public SimpleConstantContinuousBarrier inverseKnockType()
        {
            KnockType inverse = knockType.Equals(KnockType.KNOCK_IN) ? KnockType.KNOCK_OUT : KnockType.KNOCK_IN;

            return(of(barrierType, inverse, barrierLevel));
        }
예제 #8
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Obtains the continuous barrier with constant barrier level.
 /// </summary>
 /// <param name="barrierType">  the barrier type </param>
 /// <param name="knockType">  the knock type </param>
 /// <param name="barrierLevel">  the barrier level </param>
 /// <returns> the instance </returns>
 public static SimpleConstantContinuousBarrier of(BarrierType barrierType, KnockType knockType, double barrierLevel)
 {
     return(new SimpleConstantContinuousBarrier(barrierType, knockType, barrierLevel));
 }