示例#1
0
 public function testLoadFromArray()
 {
     $this->assertEquals(5, $this->tradeData->getId());
     $this->assertEquals(35, $this->tradeData->getJobId());
     $this->assertEquals(788, $this->tradeData->getAccountId());
     $this->assertEquals(1000, $this->tradeData->getSecurityId());
     $this->assertEquals('916985328', $this->tradeData->getAccountNumber());
     $this->assertEquals(TradeData::ACCOUNT_TYPE_CASH_ACCOUNT, $this->tradeData->getAccountType());
     $this->assertEquals(TradeData::SECURITY_TYPE_MUTUAL_FUND, $this->tradeData->getSecurityType());
     $this->assertEquals(TradeData::ACTION_SELL, $this->tradeData->getAction());
     $this->assertEquals(TradeData::QUANTITY_TYPE_SHARES, $this->tradeData->getQuantityType());
     $this->assertEquals(43, $this->tradeData->getQuantity());
     $this->assertEquals('RWX', $this->tradeData->getSymbol());
     $this->assertEquals('', $this->tradeData->getExchangeSwapSymbol());
     $this->assertEquals(TradeData::ORDER_TYPE_MARKET_ORDER, $this->tradeData->getOrderType());
     $this->assertEquals('', $this->tradeData->getLimitPrice());
     $this->assertEquals('', $this->tradeData->getStopPrice());
     $this->assertEquals(TradeData::TIME_IN_FORCE_GOOD_TILL_END_OF_DAY, $this->tradeData->getTimeInForce());
     $this->assertEquals('', $this->tradeData->getIsDoNotReduce());
     $this->assertEquals('', $this->tradeData->getIsAllOrNone());
     $this->assertFalse($this->tradeData->getIsReinvestDividends());
     $this->assertTrue($this->tradeData->getIsIncludeTransactionFee());
     $this->assertFalse($this->tradeData->getIsReinvestCapGains());
     $this->assertEquals(TradeData::TAX_LOT_ID_METHOD_SPECIFIC_LOT, $this->tradeData->getTaxLotIdMethod());
     $vsps = $this->tradeData->getVsps();
     $this->assertCount(2, $vsps);
     $this->assertEquals($this->vspsData, $vsps);
 }