From 89f40e197a2f131d6bcf0c6973115751e629116f 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 6bd7dfd..1d5f8e9 100644 --- a/tests/Mouson/Helpers/SequenceCalculator/DoubleSequenceCalculatorTest.php +++ b/tests/Mouson/Helpers/SequenceCalculator/DoubleSequenceCalculatorTest.php @@ -48,4 +48,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); + } }