-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
tests/Mouson/Helpers/SequenceCalculator/DoubleSequenceCalculatorTest.php
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,51 @@ | ||
<?php | ||
namespace Mouson\Helpers\SequenceCalculator; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class DoubleSequenceCalculatorTest extends TestCase | ||
{ | ||
public function test_物件產生後應可以取得物件名稱() | ||
{ | ||
/** Arrange */ | ||
$target = new DoubleSequenceCalculator(); | ||
|
||
/** Assume */ | ||
$expected = 'Double'; | ||
|
||
/** Act */ | ||
$actual = $target->getSequenceName(); | ||
|
||
/** Assert */ | ||
$this->assertEquals($expected, $actual); | ||
} | ||
|
||
public function test_測試雙倍數列輸入0應回傳0() | ||
{ | ||
/** Arrange */ | ||
$target = new DoubleSequenceCalculator(); | ||
$value = 0; | ||
/** Assume */ | ||
$expected = 0; | ||
|
||
/** Act */ | ||
$actual = $target->calculate($value); | ||
|
||
/** Assert */ | ||
$this->assertEquals($expected, $actual); | ||
} | ||
|
||
public function test_測試雙倍數列輸入2應回傳4() | ||
{ | ||
/** Arrange */ | ||
$target = new DoubleSequenceCalculator(); | ||
$value = 2; | ||
/** Assume */ | ||
$expected = 4; | ||
|
||
/** Act */ | ||
$actual = $target->calculate($value); | ||
|
||
/** Assert */ | ||
$this->assertEquals($expected, $actual); | ||
} | ||
} |