From 570721893f54e961e829ecc3620e020fae3aed01 Mon Sep 17 00:00:00 2001 From: mouson Date: Tue, 10 Jan 2017 04:00:48 +0800 Subject: [PATCH] =?UTF-8?q?Issue=20#1=20=E5=A2=9E=E5=8A=A0=E6=B8=AC?= =?UTF-8?q?=E8=A9=A6=EF=BC=9A=E8=A3=9C=E5=85=85=E9=9D=9E=E9=9B=B6=E6=95=B8?= =?UTF-8?q?=E6=B8=AC=E8=A9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DoubleSequenceCalculatorTest.php | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tests/Mouson/Helpers/SequenceCalculator/DoubleSequenceCalculatorTest.php diff --git a/tests/Mouson/Helpers/SequenceCalculator/DoubleSequenceCalculatorTest.php b/tests/Mouson/Helpers/SequenceCalculator/DoubleSequenceCalculatorTest.php new file mode 100644 index 0000000..6bd7dfd --- /dev/null +++ b/tests/Mouson/Helpers/SequenceCalculator/DoubleSequenceCalculatorTest.php @@ -0,0 +1,51 @@ +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); + } +}