|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace CyrilVerloop\Codingame\Tests\Community\Training\Easy\RobotShow; |
| 6 | + |
| 7 | +use CyrilVerloop\Codingame\Tests\PuzzleTest; |
| 8 | +use CyrilVerloop\Codingame\Community\Training\Easy\RobotShow\RobotShow; |
| 9 | + |
| 10 | +/** |
| 11 | + * Tests for the "Robot show" puzzle. |
| 12 | + * |
| 13 | + * @covers \CyrilVerloop\Codingame\Community\Training\Easy\RobotShow\RobotShow |
| 14 | + * @group robotShow |
| 15 | + */ |
| 16 | +final class CGTest extends PuzzleTest |
| 17 | +{ |
| 18 | + public function setUp(): void |
| 19 | + { |
| 20 | + $this->puzzle = new RobotShow(); |
| 21 | + } |
| 22 | + |
| 23 | + /** |
| 24 | + * Test that the code can be executed for "Example". |
| 25 | + * |
| 26 | + * @group robotShow_example |
| 27 | + */ |
| 28 | + public function testCanExecuteExample(): void |
| 29 | + { |
| 30 | + $this->expectExecuteOutputAnswer( |
| 31 | + __DIR__ . '/input/01 - example.txt', |
| 32 | + 8 . PHP_EOL |
| 33 | + ); |
| 34 | + } |
| 35 | + |
| 36 | + /** |
| 37 | + * Test that the code can be executed for "Simple". |
| 38 | + * |
| 39 | + * @group robotShow_simple |
| 40 | + */ |
| 41 | + public function testCanExecuteSimple(): void |
| 42 | + { |
| 43 | + $this->expectExecuteOutputAnswer( |
| 44 | + __DIR__ . '/input/02 - simple.txt', |
| 45 | + 20 . PHP_EOL |
| 46 | + ); |
| 47 | + } |
| 48 | + |
| 49 | + /** |
| 50 | + * Test that the code can be executed for "More bots". |
| 51 | + * |
| 52 | + * @group robotShow_moreBots |
| 53 | + */ |
| 54 | + public function testCanExecuteMoreBots(): void |
| 55 | + { |
| 56 | + $this->expectExecuteOutputAnswer( |
| 57 | + __DIR__ . '/input/03 - more bots.txt', |
| 58 | + 102 . PHP_EOL |
| 59 | + ); |
| 60 | + } |
| 61 | + |
| 62 | + /** |
| 63 | + * Test that the code can be executed for "Ping pong". |
| 64 | + * |
| 65 | + * @group robotShow_pingPong |
| 66 | + */ |
| 67 | + public function testCanExecutePingPong(): void |
| 68 | + { |
| 69 | + $this->expectExecuteOutputAnswer( |
| 70 | + __DIR__ . '/input/04 - ping pong.txt', |
| 71 | + 112 . PHP_EOL |
| 72 | + ); |
| 73 | + } |
| 74 | + |
| 75 | + /** |
| 76 | + * Test that the code can be executed for "Traffic jam". |
| 77 | + * |
| 78 | + * @group robotShow_trafficJam |
| 79 | + */ |
| 80 | + public function testCanExecuteTrafficJam(): void |
| 81 | + { |
| 82 | + $this->expectExecuteOutputAnswer( |
| 83 | + __DIR__ . '/input/05 - traffic jam.txt', |
| 84 | + 153 . PHP_EOL |
| 85 | + ); |
| 86 | + } |
| 87 | + |
| 88 | + /** |
| 89 | + * Test that the code can be executed for "Singular". |
| 90 | + * |
| 91 | + * @group robotShow_singular |
| 92 | + */ |
| 93 | + public function testCanExecuteSingular(): void |
| 94 | + { |
| 95 | + $this->expectExecuteOutputAnswer( |
| 96 | + __DIR__ . '/input/06 - singular.txt', |
| 97 | + 7 . PHP_EOL |
| 98 | + ); |
| 99 | + } |
| 100 | +} |
0 commit comments