示例#1
0
        //-------------------------------------------------------------------------
        public virtual void createOptionAutoId()
        {
            EtdOptionSecurity security = OPTION_CONTRACT.createOption(YearMonth.of(2015, 6), EtdVariant.MONTHLY, 0, PutCall.CALL, 123.45);

            assertThat(security.SecurityId).isEqualTo(SecurityId.of(EtdIdUtils.ETD_SCHEME, "O-IFEN-BAR-201506-C123.45"));
            assertThat(security.Expiry).isEqualTo(YearMonth.of(2015, 6));
            assertThat(security.ContractSpecId).isEqualTo(OPTION_CONTRACT.Id);
            assertThat(security.Variant).isEqualTo(EtdVariant.MONTHLY);
            assertThat(security.PutCall).isEqualTo(PutCall.CALL);
            assertThat(security.StrikePrice).isEqualTo(123.45);
            assertThat(security.UnderlyingExpiryMonth).Empty;
            assertThat(security.Info.PriceInfo).isEqualTo(OPTION_CONTRACT.PriceInfo);
        }
示例#2
0
 public virtual void createOptionFromFutureContractSpec()
 {
     assertThatThrownBy(() => FUTURE_CONTRACT.createOption(YearMonth.of(2015, 6), EtdVariant.MONTHLY, 0, PutCall.CALL, 123.45)).isInstanceOf(typeof(System.InvalidOperationException)).hasMessage("Cannot create an EtdOptionSecurity from a contract specification of type 'Future'");
 }