-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from bmitch/bmitchell-#27
Fixes #27
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Churn\Tests\Assessors\CyclomaticComplexity; | ||
|
||
use Churn\Tests\BaseTestCase; | ||
use Churn\Results\Result; | ||
|
||
class ResultTest extends BaseTestCase | ||
{ | ||
/** | ||
* The object we're testing. | ||
* @var Result | ||
*/ | ||
protected $result; | ||
|
||
/** @test */ | ||
public function it_can_be_created() | ||
{ | ||
$this->assertInstanceOf(Result::class, $this->result); | ||
} | ||
|
||
/** @test */ | ||
public function it_can_return_the_file() | ||
{ | ||
$this->assertSame('filename.php', $this->result->getFile()); | ||
} | ||
|
||
/** @test */ | ||
public function it_can_return_the_commits() | ||
{ | ||
$this->assertSame(5, $this->result->getCommits()); | ||
} | ||
|
||
/** @test */ | ||
public function it_can_return_the_complexity() | ||
{ | ||
$this->assertSame(7, $this->result->getComplexity()); | ||
} | ||
|
||
/** @test */ | ||
public function it_can_calculate_the_score() | ||
{ | ||
$this->assertSame(12, $this->result->getScore()); | ||
} | ||
|
||
public function setup() | ||
{ | ||
$this->result = new Result([ | ||
'file' => 'filename.php', | ||
'commits' => 5, | ||
'complexity' => 7, | ||
]); | ||
} | ||
} |