51 lines
1.1 KiB
PHP
51 lines
1.1 KiB
PHP
<?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 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());
|
|
}
|
|
|
|
/**
|
|
* @expectedException \Enzyme\Axiom\Exceptions\AtomException
|
|
*/
|
|
public function testCreateAtom0Fails()
|
|
{
|
|
$value = 0;
|
|
|
|
$result = new UnsignedIntegerAtom($value);
|
|
|
|
$this->assertEquals(false, $result, 'should have failed to create');
|
|
}
|
|
|
|
/**
|
|
* @expectedException \Enzyme\Axiom\Exceptions\AtomException
|
|
*/
|
|
public function testCreateNegativeAtomFails()
|
|
{
|
|
$value = -1;
|
|
|
|
$result = new UnsignedIntegerAtom($value);
|
|
|
|
$this->assertEquals(false, $result, 'should have failed to create');
|
|
}
|
|
}
|