Skip to content

Commit

Permalink
Add some test for more autoColors
Browse files Browse the repository at this point in the history
  • Loading branch information
yakatz committed Sep 16, 2020
1 parent 0239158 commit 6fce4b5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/AutoColorUtilsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

use LasseRafn\InitialAvatarGenerator\InitialAvatar;
use PHPUnit\Framework\TestCase;

class AutoColorUtilsTest extends TestCase
{
/** @test */
public function can_create_all_colors()
{
$avatar = new InitialAvatar();

$avatar->name('A')->autoColor();
$this->assertEquals('#f0a742', $avatar->getBackgroundColor());
$this->assertEquals('#000000', $avatar->getColor());

$avatar->name('B')->autoColor();
$this->assertEquals('#42caf0', $avatar->getBackgroundColor());
$this->assertEquals('#000000', $avatar->getColor());

$avatar->name('C')->autoColor();
$this->assertEquals('#42f085', $avatar->getBackgroundColor());
$this->assertEquals('#000000', $avatar->getColor());

$avatar->name('D')->autoColor();
$this->assertEquals('#f04293', $avatar->getBackgroundColor());
$this->assertEquals('#ffffff', $avatar->getColor());
}
}

0 comments on commit 6fce4b5

Please sign in to comment.