|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace CyrilVerloop\Codingame\Tests\Training\Hard\Winamax; |
| 6 | + |
| 7 | +use CyrilVerloop\Codingame\Tests\PuzzleTest; |
| 8 | +use CyrilVerloop\Codingame\Training\Hard\Winamax\Winamax; |
| 9 | + |
| 10 | +/** |
| 11 | + * Tests for the "Winamax" puzzle. |
| 12 | + * |
| 13 | + * @covers \CyrilVerloop\Codingame\Training\Hard\Winamax\Winamax |
| 14 | + * @group winamax |
| 15 | + */ |
| 16 | +final class WinamaxTest extends PuzzleTest |
| 17 | +{ |
| 18 | + public function setUp(): void |
| 19 | + { |
| 20 | + $this->puzzle = new Winamax(); |
| 21 | + } |
| 22 | + |
| 23 | + /** |
| 24 | + * Test that the code can be executed for "Test 1". |
| 25 | + * |
| 26 | + * @group winamax_test1 |
| 27 | + */ |
| 28 | + public function testCanExecuteTest1(): void |
| 29 | + { |
| 30 | + $this->expectExecuteOutputAnswer( |
| 31 | + __DIR__ . '/input/01 - test 1.txt', |
| 32 | + '>.' . PHP_EOL |
| 33 | + ); |
| 34 | + } |
| 35 | + |
| 36 | + /** |
| 37 | + * Test that the code can be executed for "Test 2". |
| 38 | + * |
| 39 | + * @group winamax_test2 |
| 40 | + */ |
| 41 | + public function testCanExecuteTest2(): void |
| 42 | + { |
| 43 | + $this->expectExecuteOutputAnswer( |
| 44 | + __DIR__ . '/input/02 - test 2.txt', |
| 45 | + file_get_contents(__DIR__ . '/output/02 - test 2.txt') |
| 46 | + ); |
| 47 | + } |
| 48 | + |
| 49 | + /** |
| 50 | + * Test that the code can be executed for "Test 3". |
| 51 | + * |
| 52 | + * @group winamax_test3 |
| 53 | + */ |
| 54 | + public function testCanExecuteTest3(): void |
| 55 | + { |
| 56 | + $this->expectExecuteOutputAnswer( |
| 57 | + __DIR__ . '/input/03 - test 3.txt', |
| 58 | + file_get_contents(__DIR__ . '/output/03 - test 3.txt') |
| 59 | + ); |
| 60 | + } |
| 61 | + |
| 62 | + /** |
| 63 | + * Test that the code can be executed for "Test 4". |
| 64 | + * |
| 65 | + * @group winamax_test4 |
| 66 | + */ |
| 67 | + public function testCanExecuteTest4(): void |
| 68 | + { |
| 69 | + $this->expectExecuteOutputAnswer( |
| 70 | + __DIR__ . '/input/04 - test 4.txt', |
| 71 | + file_get_contents(__DIR__ . '/output/04 - test 4.txt') |
| 72 | + ); |
| 73 | + } |
| 74 | + |
| 75 | + /** |
| 76 | + * Test that the code can be executed for "Test 5". |
| 77 | + * |
| 78 | + * @group winamax_test5 |
| 79 | + */ |
| 80 | + public function testCanExecuteTest5(): void |
| 81 | + { |
| 82 | + $this->expectExecuteOutputAnswer( |
| 83 | + __DIR__ . '/input/05 - test 5.txt', |
| 84 | + file_get_contents(__DIR__ . '/output/05 - test 5.txt') |
| 85 | + ); |
| 86 | + } |
| 87 | + |
| 88 | + /** |
| 89 | + * Test that the code can be executed for "Test 6". |
| 90 | + * |
| 91 | + * @group winamax_test6 |
| 92 | + */ |
| 93 | + public function testCanExecuteTest6(): void |
| 94 | + { |
| 95 | + $this->expectExecuteOutputAnswer( |
| 96 | + __DIR__ . '/input/06 - test 6.txt', |
| 97 | + file_get_contents(__DIR__ . '/output/06 - test 6.txt') |
| 98 | + ); |
| 99 | + } |
| 100 | + |
| 101 | + /** |
| 102 | + * Test that the code can be executed for "Test 7". |
| 103 | + * |
| 104 | + * @group winamax_test7 |
| 105 | + */ |
| 106 | + public function testCanExecuteTest7(): void |
| 107 | + { |
| 108 | + $this->expectExecuteOutputAnswer( |
| 109 | + __DIR__ . '/input/07 - test 7.txt', |
| 110 | + file_get_contents(__DIR__ . '/output/07 - test 7.txt') |
| 111 | + ); |
| 112 | + } |
| 113 | + |
| 114 | + /** |
| 115 | + * Test that the code can be executed for "Test 8". |
| 116 | + * |
| 117 | + * @group winamax_test8 |
| 118 | + */ |
| 119 | + public function testCanExecuteTest8(): void |
| 120 | + { |
| 121 | + $this->expectExecuteOutputAnswer( |
| 122 | + __DIR__ . '/input/08 - test 8.txt', |
| 123 | + file_get_contents(__DIR__ . '/output/08 - test 8.txt') |
| 124 | + ); |
| 125 | + } |
| 126 | + |
| 127 | + /** |
| 128 | + * Test that the code can be executed for "Test 9". |
| 129 | + * |
| 130 | + * @group winamax_test9 |
| 131 | + */ |
| 132 | + public function testCanExecuteTest9(): void |
| 133 | + { |
| 134 | + $this->expectExecuteOutputAnswer( |
| 135 | + __DIR__ . '/input/09 - test 9.txt', |
| 136 | + file_get_contents(__DIR__ . '/output/09 - test 9.txt') |
| 137 | + ); |
| 138 | + } |
| 139 | + |
| 140 | + /** |
| 141 | + * Test that the code can be executed for "Test 10". |
| 142 | + * |
| 143 | + * @group winamax_test10 |
| 144 | + */ |
| 145 | + public function testCanExecuteTest10(): void |
| 146 | + { |
| 147 | + $this->expectExecuteOutputAnswer( |
| 148 | + __DIR__ . '/input/10 - test 10.txt', |
| 149 | + file_get_contents(__DIR__ . '/output/10 - test 10.txt') |
| 150 | + ); |
| 151 | + } |
| 152 | + |
| 153 | + /** |
| 154 | + * Test that the code can be executed for "Test 11". |
| 155 | + * |
| 156 | + * @group winamax_test11 |
| 157 | + */ |
| 158 | + public function testCanExecuteTest11(): void |
| 159 | + { |
| 160 | + $this->expectExecuteOutputAnswer( |
| 161 | + __DIR__ . '/input/11 - test 11.txt', |
| 162 | + file_get_contents(__DIR__ . '/output/11 - test 11.txt') |
| 163 | + ); |
| 164 | + } |
| 165 | + |
| 166 | + /** |
| 167 | + * Test that the code can be executed for "Test 12". |
| 168 | + * |
| 169 | + * @group winamax_test12 |
| 170 | + */ |
| 171 | + public function testCanExecuteTest12(): void |
| 172 | + { |
| 173 | + $this->expectExecuteOutputAnswer( |
| 174 | + __DIR__ . '/input/12 - test 12.txt', |
| 175 | + file_get_contents(__DIR__ . '/output/12 - test 12.txt') |
| 176 | + ); |
| 177 | + } |
| 178 | + |
| 179 | + /** |
| 180 | + * Test that the code can be executed for "Test 13". |
| 181 | + * |
| 182 | + * @group winamax_test13 |
| 183 | + */ |
| 184 | + public function testCanExecuteTest13(): void |
| 185 | + { |
| 186 | + $this->expectExecuteOutputAnswer( |
| 187 | + __DIR__ . '/input/13 - test 13.txt', |
| 188 | + file_get_contents(__DIR__ . '/output/13 - test 13.txt') |
| 189 | + ); |
| 190 | + } |
| 191 | + |
| 192 | + /** |
| 193 | + * Test that the code can be executed for "Test 14". |
| 194 | + * |
| 195 | + * @group winamax_test14 |
| 196 | + */ |
| 197 | + public function testCanExecuteTest14(): void |
| 198 | + { |
| 199 | + $this->expectExecuteOutputAnswer( |
| 200 | + __DIR__ . '/input/14 - test 14.txt', |
| 201 | + file_get_contents(__DIR__ . '/output/14 - test 14.txt') |
| 202 | + ); |
| 203 | + } |
| 204 | + |
| 205 | + /** |
| 206 | + * Test that the code can be executed for "Test 15". |
| 207 | + * |
| 208 | + * @group winamax_test15 |
| 209 | + */ |
| 210 | + public function testCanExecuteTest15(): void |
| 211 | + { |
| 212 | + $this->expectExecuteOutputAnswer( |
| 213 | + __DIR__ . '/input/15 - test 15.txt', |
| 214 | + file_get_contents(__DIR__ . '/output/15 - test 15.txt') |
| 215 | + ); |
| 216 | + } |
| 217 | + |
| 218 | + /** |
| 219 | + * Test that the code can be executed for "Test 16". |
| 220 | + * |
| 221 | + * @group winamax_test16 |
| 222 | + */ |
| 223 | + public function testCanExecuteTest16(): void |
| 224 | + { |
| 225 | + $this->expectExecuteOutputAnswer( |
| 226 | + __DIR__ . '/input/16 - test 16.txt', |
| 227 | + file_get_contents(__DIR__ . '/output/16 - test 16.txt') |
| 228 | + ); |
| 229 | + } |
| 230 | + |
| 231 | + /** |
| 232 | + * Test that the code can be executed for "Test 17". |
| 233 | + * |
| 234 | + * @group winamax_test17 |
| 235 | + */ |
| 236 | + public function testCanExecuteTest17(): void |
| 237 | + { |
| 238 | + $this->expectExecuteOutputAnswer( |
| 239 | + __DIR__ . '/input/17 - test 17.txt', |
| 240 | + file_get_contents(__DIR__ . '/output/17 - test 17.txt') |
| 241 | + ); |
| 242 | + } |
| 243 | + |
| 244 | + /** |
| 245 | + * Test that the code can be executed for "Test 18". |
| 246 | + * |
| 247 | + * @group winamax_test18 |
| 248 | + */ |
| 249 | + public function testCanExecuteTest18(): void |
| 250 | + { |
| 251 | + $this->expectExecuteOutputAnswer( |
| 252 | + __DIR__ . '/input/18 - test 18.txt', |
| 253 | + file_get_contents(__DIR__ . '/output/18 - test 18.txt') |
| 254 | + ); |
| 255 | + } |
| 256 | + |
| 257 | + /** |
| 258 | + * Test that the code can be executed for "Test 19". |
| 259 | + * |
| 260 | + * @group winamax_test19 |
| 261 | + */ |
| 262 | + public function testCanExecuteTest19(): void |
| 263 | + { |
| 264 | + $this->expectExecuteOutputAnswer( |
| 265 | + __DIR__ . '/input/19 - test 19.txt', |
| 266 | + file_get_contents(__DIR__ . '/output/19 - test 19.txt') |
| 267 | + ); |
| 268 | + } |
| 269 | + |
| 270 | + /** |
| 271 | + * Test that the code can be executed for "Test 20". |
| 272 | + * |
| 273 | + * @group winamax_test20 |
| 274 | + */ |
| 275 | + public function testCanExecuteTest20(): void |
| 276 | + { |
| 277 | + $this->expectExecuteOutputAnswer( |
| 278 | + __DIR__ . '/input/20 - test 20.txt', |
| 279 | + file_get_contents(__DIR__ . '/output/20 - test 20.txt') |
| 280 | + ); |
| 281 | + } |
| 282 | + |
| 283 | + /** |
| 284 | + * Test that the code can be executed for "Test 21". |
| 285 | + * |
| 286 | + * @group winamax_test21 |
| 287 | + */ |
| 288 | + public function testCanExecuteTest21(): void |
| 289 | + { |
| 290 | + $this->expectExecuteOutputAnswer( |
| 291 | + __DIR__ . '/input/21 - test 21.txt', |
| 292 | + file_get_contents(__DIR__ . '/output/21 - test 21.txt') |
| 293 | + ); |
| 294 | + } |
| 295 | +} |
0 commit comments