Initial Commit
This commit is contained in:
commit
ddf09fe00c
113 changed files with 187148 additions and 0 deletions
33
tests/Feature/Game/GameBoardTest.php
Normal file
33
tests/Feature/Game/GameBoardTest.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Game;
|
||||
|
||||
use App\Models\Card;
|
||||
use App\Game\GameBoard;
|
||||
use App\Game\GameBoardState;
|
||||
use App\Game\Exceptions\NotEnoughCardsException;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class GameBoardTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_exception_is_thrown_if_there_is_not_enough_cards_to_fill_it()
|
||||
{
|
||||
Card::factory()->count(10)->create();
|
||||
|
||||
$this->expectException(NotEnoughCardsException::class);
|
||||
|
||||
$board = new GameBoard(new GameBoardState(5, 5));
|
||||
}
|
||||
|
||||
public function test_exception_is_not_thrown_if_there_is_enough_cards_to_fill_it()
|
||||
{
|
||||
Card::factory()->count(32)->create();
|
||||
|
||||
$board = new GameBoard(new GameBoardState(4, 4));
|
||||
$this->assertSame(16, $board->getSize());
|
||||
}
|
||||
}
|
||||
Reference in a new issue