Ejemplo n.º 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;
 }
Ejemplo n.º 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);
            }
Ejemplo n.º 3
0
 public virtual void test_of_lookup_null()
 {
     assertThrowsIllegalArg(() => KnockType.of(null));
 }
Ejemplo n.º 4
0
 public virtual void test_of_lookup_notFound()
 {
     assertThrowsIllegalArg(() => KnockType.of("Rubbish"));
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 7
0
        public SimpleConstantContinuousBarrier inverseKnockType()
        {
            KnockType inverse = knockType.Equals(KnockType.KNOCK_IN) ? KnockType.KNOCK_OUT : KnockType.KNOCK_IN;

            return(of(barrierType, inverse, barrierLevel));
        }
Ejemplo n.º 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));
 }