Esempio n. 1
0
 /**
  * @test
  */
 public function testGetSampleInputForm()
 {
     $im = new InputForm();
     $sampleArray = $im->getSampleForm();
     $this->assertEquals(count($sampleArray), 14);
     $this->assertEquals($sampleArray['loanAmount'], 240000);
     $this->assertEquals($sampleArray['occType'], LoanerConst::PRIMARY_HOME);
     $this->assertEquals($sampleArray['type'], LoanerConst::HOUSE);
 }
Esempio n. 2
0
 /**
  * @test
  */
 public function testSetFixedFees()
 {
     $testInputForm = new InputForm();
     $testInputs = $testInputForm->getSampleForm();
     $testLoanProperty = new LoanProperty($testInputs);
     $testCalculator = new FeeCalculator($testLoanProperty);
     $testCalculator->setFixedFees();
     $this->assertEquals(18.0, $testCalculator->getFeesArray()['804 credit_report']);
     $this->assertEquals(850.0, $testCalculator->getFeesArray()['801 Origination']);
     $this->assertEquals(87.0, $testCalculator->getFeesArray()['TaxService']);
     $this->assertEquals(85.0, $testCalculator->getFeesArray()['HomeRegistration']);
 }
Esempio n. 3
0
 /**
  * @test
  */
 public function testGetAdjustsVary()
 {
     $testInputForm = new InputForm();
     $testInputs = $testInputForm->getSampleForm();
     $testInputs['loanAmount'] = 295000;
     $testInputs['creditScore'] = 710;
     $testInputs['type'] = LoanerConst::CONDO;
     $testLoanProperty = new LoanProperty($testInputs);
     $testCalculator = new BBTRateCalculator();
     $testCalculator->setProperty($testLoanProperty);
     $testCalculator->setTotalFee(2500);
     $testCalculator->calculateAllAdjusts();
     $testAdjusts = $testCalculator->getAdjusts();
     $this->assertEquals(-1.0, $testAdjusts['LtvCcAdj']);
     //700 with 0.98
     $this->assertEquals(-2.5, $testAdjusts['LtvCcPmiAdj']);
     //700 with 0.98
     $this->assertEquals(-0.75, $testAdjusts['LtvOtherAdj']);
     //condo
     $this->assertEquals(-4.25, $testCalculator->getTotalAdjusts());
 }