public function testFindOneByRia()
 {
     $riaRepo = new RiaRepository();
     $ria = $riaRepo->findOneBy(array('email' => 'johnny@wealthbot.io'));
     $riaCompanyInformation = $this->riaCompanyInfoRepo->findOneByRia($ria);
     $this->assertEquals($ria, $riaCompanyInformation->getRia());
     $this->assertNotNull($riaCompanyInformation->getId());
     $this->assertTrue($riaCompanyInformation->getUseTransactionFees());
 }
 public function testBindForJob()
 {
     $riaRepo = new RiaRepository();
     $ria = $riaRepo->findOneBy(array('email' => 'raiden@wealthbot.io'));
     $jobRepo = new JobRepository();
     $job = $jobRepo->findOneBy(array('user_id' => $ria->getId()));
     $rebalancerActions = $this->repository->bindForJob($job);
     $this->assertCount(2, $rebalancerActions);
     /** @var RebalancerAction $rebalancerAction */
     foreach ($rebalancerActions as $rebalancerAction) {
         $this->assertEquals($job, $rebalancerAction->getJob());
     }
 }
Ejemplo n.º 3
0
 public function testFindOneByClient()
 {
     $clientRepo = new ClientRepository();
     $client = $clientRepo->findClientByEmail('johnny@wealthbot.io');
     $ria = $this->repository->findOneByClient($client);
     $this->assertEquals('raiden@wealthbot.io', $ria->getEmail());
     $this->assertEquals(true, $ria->getIsTlhEnabled());
     $this->assertEquals(0.1, $ria->getClientTaxBracket());
     $this->assertEquals(50000, $ria->getMinRelationshipValue());
     $this->assertEquals(100, $ria->getMinTlh());
     $this->assertEquals(0.1, $ria->getMinTlhPercent());
     $this->assertTrue($ria->getIsUseMunicipalBond());
     $this->assertTrue($ria->getuseTransactionFees());
 }
 public function testFindVSPForTradeData()
 {
     $riaRepo = new RiaRepository();
     $ria = $riaRepo->findOneBy(array('email' => 'raiden@wealthbot.io'));
     $jobRepo = new JobRepository();
     $job = $jobRepo->findOneBy(array('user_id' => $ria->getId()));
     $accountRepo = new AccountRepository();
     $securityRepo = new SecurityRepository();
     $tradeData = new TradeData();
     $tradeData->setJobId($job->getId());
     $tradeData->setAccountId($accountRepo->findOneByAccountNumber('916985328')->getId());
     $tradeData->setSecurityId($securityRepo->findOneBySymbol('RWX')->getId());
     $vsps = $this->repository->findVSPForTradeData($tradeData);
     $vspsExpected = array(array('purchase' => 'VSP', 'purchase_date' => '02132013', 'quantity' => 36), array('purchase' => 'VSP', 'purchase_date' => '02162013', 'quantity' => 20));
     $this->assertEquals($vspsExpected, $vsps);
 }