Exemple #1
0
 public function testEquivalenceWithBanister()
 {
     $Data = array(0 => 150, 1 => 50, 2 => 40, 5 => 60, 6 => 30, 7 => 100);
     $Banister = new Banister($Data, 42, 7, 1, 2);
     $Banister->calculate();
     $Busso = new Busso($Data, 42, 7, 4, 1, 2);
     $Busso->calculate();
     for ($i = 0; $i <= 7; ++$i) {
         $this->assertEquals($Banister->fitnessAt($i), $Busso->fitnessAt($i), 'Banister and Busso fitness is not equal at day ' . $i);
         $this->assertEquals($Banister->fatigueAt($i), $Busso->fatigueAt($i), 'Banister and Busso fatigue is not equal at day ' . $i);
     }
 }
Exemple #2
0
 public function testFutureFatigue()
 {
     $Model = new Banister(array(0 => 1000), 42, 7, 1, 2);
     $Model->setRange(0, 30);
     $Model->calculate();
     $this->assertEquals(867, $Model->fatigueAt(1));
     $this->assertEquals(490, $Model->fatigueAt(5));
     $this->assertEquals(240, $Model->fatigueAt(10));
     $this->assertEquals(117, $Model->fatigueAt(15));
     $this->assertEquals(57, $Model->fatigueAt(20));
     $this->assertEquals(28, $Model->fatigueAt(25));
 }