Files
abcParser/tests/unit/AbcParser/Domain/Atoms/UnsignedIntegerAtomTest.php
richard 1130f9a22f
Some checks failed
abc-api/abcParser/pipeline/head There was a failure building this commit
update to lumen 7
2020-06-24 11:58:32 -04:00

48 lines
1.1 KiB
PHP
Executable File

<?php
/**
* Created by PhpStorm.
* User: richard
* Date: 11/25/17
* Time: 5:06 PM
*/
namespace Tests\Unit\AbcParser\Domain\Atoms;
use Enzyme\Axiom\Atoms\AtomInterface;
use Enzyme\Axiom\Exceptions\AtomException;
use PHPUnit_Framework_TestCase;
use XaiCorp\AbcParser\Domain\Atoms\UnsignedIntegerAtom;
class UnsignedIntegerAtomTest extends PHPUnit_Framework_TestCase
{
public function testCreateAtom()
{
$value = 1;
$result = new UnsignedIntegerAtom($value);
$this->assertInstanceOf(AtomInterface::class, $result);
$this->assertEquals($value, $result->getValue());
}
public function testCreateAtom0Fails()
{
$value = 0;
$this->expectException(AtomException::class);
$result = new UnsignedIntegerAtom($value);
$this->assertEquals(false, $result, 'should have failed to create');
}
public function testCreateNegativeAtomFails()
{
$value = -1;
$this->expectException(AtomException::class);
$result = new UnsignedIntegerAtom($value);
$this->assertEquals(false, $result, 'should have failed to create');
}
}