Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Oct 1, 2021
1 parent bab65b1 commit 5af8436
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/Containers/AppSection/User/Tests/Unit/DeleteUserTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Containers\AppSection\User\Tests\Unit;

use App\Containers\AppSection\User\Models\User;
use App\Containers\AppSection\User\Tasks\DeleteUserTask;
use App\Containers\AppSection\User\Tests\TestCase;
use App\Ship\Exceptions\DeleteResourceFailedException;
use App\Ship\Exceptions\NotFoundException;

/**
Expand All @@ -15,6 +15,15 @@
*/
class DeleteUserTaskTest extends TestCase
{
public function testDeleteUser(): void
{
$user = User::factory()->create();

$result = app(DeleteUserTask::class)->run($user->id);

$this->assertEquals(1, $result);
}

public function testDeleteUserWithInvalidId(): void
{
$this->expectException(NotFoundException::class);
Expand Down

0 comments on commit 5af8436

Please sign in to comment.