From f3d19bc9bcaecfae55aba7692542a4d644c5f23d Mon Sep 17 00:00:00 2001 From: mouson Date: Tue, 10 Jan 2017 04:01:07 +0800 Subject: [PATCH] =?UTF-8?q?Issue=20#1=20=E5=A2=9E=E5=8A=A0=E8=B2=A0?= =?UTF-8?q?=E6=95=B8=E6=B8=AC=E8=A9=A6=E6=A1=88=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DoubleSequenceCalculatorTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/Mouson/Helpers/SequenceCalculator/DoubleSequenceCalculatorTest.php b/tests/Mouson/Helpers/SequenceCalculator/DoubleSequenceCalculatorTest.php index a9de5e2..9f60c68 100644 --- a/tests/Mouson/Helpers/SequenceCalculator/DoubleSequenceCalculatorTest.php +++ b/tests/Mouson/Helpers/SequenceCalculator/DoubleSequenceCalculatorTest.php @@ -47,4 +47,19 @@ public function test_測試雙倍數列輸入2應回傳4() /** Assert */ $this->assertEquals($expected, $actual); } + + public function test_測試雙倍數列輸入負數應回傳兩倍負數() + { + /** Arrange */ + $target = new DoubleSequenceCalculator(); + $value = -2; + /** Assume */ + $expected = -4; + + /** Act */ + $actual = $target->calculate($value); + + /** Assert */ + $this->assertEquals($expected, $actual); + } }