Skip to content

Commit

Permalink
Add unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
markrogoyski committed Jul 31, 2016
1 parent 61c0bb1 commit 2ec1be0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/SubnetCalculatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ public function testGetNumberAddressableHosts()
$this->assertEquals($this->sub->getNumberAddressableHosts(), NUMBER_ADDRESSABLE_HOSTS);
}

public function testGetNumberAddressableHostsEdgeCases()
{
$sub = new SubnetCalculator('192.168.112.203', 32);
$this->assertEquals(1, $sub->getNumberAddressableHosts());

$sub = new SubnetCalculator('192.168.112.203', 31);
$this->assertEquals(2, $sub->getNumberAddressableHosts());
}

public function testGetIPAddressRange()
{
$this->assertEquals($this->sub->getIPAddressRange()[0], LOWER_IP_ADDRESS_RANGE);
Expand Down

0 comments on commit 2ec1be0

Please sign in to comment.