Add testdox

This commit is contained in:
Dennis Eichhorn 2019-04-28 21:14:46 +02:00
parent 6f2dd4d30a
commit b250f24880
2 changed files with 36 additions and 2 deletions

View File

@ -17,10 +17,15 @@ namespace phpOMS\tests\Business\Finance;
use phpOMS\Business\Finance\Depreciation;
/**
* @testdox phpOMS\Business\Finance\DepreciationTest: Depreciation calculations
*
* @internal
*/
class DepreciationTest extends \PHPUnit\Framework\TestCase
{
/**
* @testdox The straight line deprecition and reverse value calculations are correct
*/
public function testStraightLine() : void
{
$start = 23280;
@ -31,6 +36,9 @@ class DepreciationTest extends \PHPUnit\Framework\TestCase
self::assertEqualsWithDelta(23280 - 3880 * $t, Depreciation::getStraightLineResidualInT($start, $duration, $t), 5);
}
/**
* @testdox The arithmetic degressiv deprecition and reverse value calculations are correct
*/
public function testArithmeticDegressivDepreciation() : void
{
$start = 150000;
@ -43,6 +51,9 @@ class DepreciationTest extends \PHPUnit\Framework\TestCase
self::assertEqualsWithDelta(70800, Depreciation::getArithmeticDegressivDepreciationResidualInT($start, $residual, $duration, $t), 5);
}
/**
* @testdox The arithmetic progressiv deprecition and reverse value calculations are correct
*/
public function testArithmeticProgressivDepreciation() : void
{
$start = 40000;
@ -55,7 +66,10 @@ class DepreciationTest extends \PHPUnit\Framework\TestCase
self::assertEqualsWithDelta(29410, Depreciation::getArithmeticProgressivDepreciationResidualInT($start, $residual, $duration, $t), 5);
}
public function testGeometicProgressivDepreciation() : void
/**
* @testdox The geometric progressiv deprecition and reverse value calculations are correct
*/
public function testGeometricProgressivDepreciation() : void
{
$start = 150000;
$residual = 18000;
@ -67,7 +81,10 @@ class DepreciationTest extends \PHPUnit\Framework\TestCase
self::assertEqualsWithDelta(125965, Depreciation::getGeometicProgressivDepreciationResidualInT($start, $residual, $duration, $t), 5);
}
public function testGeometicDegressivDepreciation() : void
/**
* @testdox The geometric degressiv deprecition and reverse value calculations are correct
*/
public function testGeometricDegressivDepreciation() : void
{
$start = 150000;
$residual = 18000;

View File

@ -17,10 +17,15 @@ namespace phpOMS\tests\Business\Finance;
use phpOMS\Business\Finance\FinanceFormulas;
/**
* @testdox phpOMS\Business\Finance\FinanceFormulas: Finance formulas
*
* @internal
*/
class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
{
/**
* @testdox The annual percentage yield (APY) and reverse value calculations are correct
*/
public function testAnnualPercentageYield() : void
{
$expected = 0.06168;
@ -33,6 +38,9 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals(\round($r, 2), FinanceFormulas::getStateAnnualInterestRateOfAPY($apy, $n));
}
/**
* @testdox The future value of annuity (FVA) and reverse value calculations are correct
*/
public function testFutureValueOfAnnuity() : void
{
$expected = 5204.04;
@ -47,6 +55,9 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals(\round($P, 2), \round(FinanceFormulas::getPeriodicPaymentOfFVA($fva, $r, $n), 2));
}
/**
* @testdox The future value of annuity continuous compounding (FVACC) and reverse value calculations are correct
*/
public function testFutureValueOfAnnuityContinuousCompounding() : void
{
$expected = 12336.42;
@ -61,6 +72,9 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals($t, FinanceFormulas::getTimeOfFVACC($fvacc, $cf, $r));
}
/**
* @testdox The annuity payment from the present value (PV) and reverse value calculations are correct
*/
public function testAnnuityPaymentPV() : void
{
$expected = 212.16;
@ -75,6 +89,9 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals(\round($pv, 2), \round(FinanceFormulas::getPresentValueOfAPPV($p, $r, $n), 2));
}
/**
* @testdox The annuity payment from the future value (FV) and reverse value calculations are correct
*/
public function testAnnuityPaymentFV() : void
{
$expected = 192.16;