Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #27 #28

Merged
merged 1 commit into from
Jun 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
]);
}
}