| Total Complexity | 6 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | final class StaticSuccessCalculatorTest extends \Tester\TestCase { |
||
| 15 | protected StaticSuccessCalculator $calculator; |
||
| 16 | |||
| 17 | protected function setUp() { |
||
| 18 | $this->calculator = new StaticSuccessCalculator(); |
||
| 19 | } |
||
| 20 | |||
| 21 | protected function generateCharacter(int $id): Character { |
||
| 22 | $stats = [ |
||
| 23 | "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
||
| 24 | "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10 |
||
| 25 | ]; |
||
| 26 | return new Character($stats); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function testHasHit(): void { |
||
| 30 | $character1 = $this->generateCharacter(1); |
||
| 31 | $character2 = $this->generateCharacter(2); |
||
| 32 | for($i = 1; $i <= 10; $i++) { |
||
| 33 | Assert::true($this->calculator->hasHit($character1, $character2)); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | public function testHasHealed(): void { |
||
| 41 | } |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 47 | ?> |