Skip to content

Commit

Permalink
Merge pull request #28 from bmitch/bmitchell-#27
Browse files Browse the repository at this point in the history
Fixes #27
  • Loading branch information
bmitch committed Jun 20, 2017
2 parents 07db9fd + 9a6d227 commit 3b01855
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions tests/Unit/Results/ResultTest.php
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,
]);
}
}

0 comments on commit 3b01855

Please sign in to comment.