Skip to content

Commit e34939b

Browse files
committed
Add tests with 100% coverage for new GraphProperty algorithm
1 parent 0c04cd4 commit e34939b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/Property/PropertyGraphTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
use Fhaculty\Graph\Graph;
4+
use Fhaculty\Graph\Algorithm\Property\GraphProperty;
5+
6+
class PropertyGraphTest extends TestCase
7+
{
8+
public function testEmptyIsEdgeless()
9+
{
10+
$graph = new Graph($graph);
11+
12+
$alg = new GraphProperty($graph);
13+
14+
$this->assertTrue($alg->isEdgeless());
15+
$this->assertFalse($alg->isTrivial());
16+
}
17+
18+
public function testSingleVertexIsTrivial()
19+
{
20+
$graph = new Graph();
21+
$graph->createVertex(1);
22+
23+
$alg = new GraphProperty($graph);
24+
25+
$this->assertTrue($alg->isTrivial());
26+
}
27+
}

0 commit comments

Comments
 (0)