Skip to content

Commit

Permalink
Add more Test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
trandangtri committed May 9, 2018
1 parent 34e674d commit 29624da
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Tests/Unit/Service/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@ public function testConstruction()
{
$body = 'my-body';
$attributes = ['a', 'b', 'c'];
$message = new Message($body, $attributes);
$groupId = 'group-id';
$deduplicationID = 'deduplication-id';
$message = new Message($body, $attributes, $groupId, $deduplicationID);

$this->assertInstanceOf(Message::class, $message);
$this->assertEquals($body, $message->getBody());
$this->assertEquals($attributes, $message->getAttributes());
$this->assertEquals($groupId, $message->getGroupId());
$this->assertEquals($deduplicationID, $message->getDeduplicationId());
}

/**
* Test: Getter/Setter
*/
public function testGetterSetter()
{
$message = new Message('', []);
$message = new Message('', [], '', '');

$this->assertInstanceOf(Message::class, $message->setId('my-id'));
$this->assertEquals('my-id', $message->getId());
Expand All @@ -40,5 +44,9 @@ public function testGetterSetter()
$this->assertEquals(['a', 'b', 'c'], $message->getAttributes());
$this->assertInstanceOf(Message::class, $message->setReceiptHandle('my-receipt'));
$this->assertEquals('my-receipt', $message->getReceiptHandle());
$this->assertInstanceOf(Message::class, $message->setGroupId('group-id'));
$this->assertEquals('group-id', $message->getGroupId());
$this->assertInstanceOf(Message::class, $message->setDeduplicationId('deduplication-id'));
$this->assertEquals('deduplication-id', $message->getDeduplicationId());
}
}

0 comments on commit 29624da

Please sign in to comment.