From 9a6d22766838544cfe531c16f279595ce1f7b5fd Mon Sep 17 00:00:00 2001 From: Bill Mitchell Date: Tue, 20 Jun 2017 16:54:10 -0700 Subject: [PATCH] Fixes #27 --- tests/Unit/Results/ResultTest.php | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tests/Unit/Results/ResultTest.php diff --git a/tests/Unit/Results/ResultTest.php b/tests/Unit/Results/ResultTest.php new file mode 100644 index 00000000..762ede62 --- /dev/null +++ b/tests/Unit/Results/ResultTest.php @@ -0,0 +1,54 @@ +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, + ]); + } +} \ No newline at end of file