finished default parser
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user