[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 03/03: Test unitaire avec PHPUNIT class_acc_c
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 03/03: Test unitaire avec PHPUNIT class_acc_compute.php |
Date: |
Mon, 03 Nov 2014 19:35:17 +0000 |
sparkyx pushed a commit to branch master
in repository noalyss.
commit af5cba03a980a5c4edc9c0780b3ddcab3c14afa9
Author: Dany De Bontridder <address@hidden>
Date: Mon Nov 3 20:33:54 2014 +0100
Test unitaire avec PHPUNIT class_acc_compute.php
---
unit-test/include/class_acc_computeTest.php | 185 +++++++++++++++++++++++++++
1 files changed, 185 insertions(+), 0 deletions(-)
diff --git a/unit-test/include/class_acc_computeTest.php
b/unit-test/include/class_acc_computeTest.php
new file mode 100644
index 0000000..166da06
--- /dev/null
+++ b/unit-test/include/class_acc_computeTest.php
@@ -0,0 +1,185 @@
+<?php
+
+/**
+ * Generated by PHPUnit_SkeletonGenerator on 2014-10-31 at 20:33:23.
+ */
+class Acc_ComputeTest extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * @var Acc_Compute
+ */
+ protected $object;
+
+ /**
+ * Sets up the fixture, for example, opens a network connection.
+ * This method is called before a test is executed.
+ */
+ protected function setUp()
+ {
+ $this->object=new Acc_Compute;
+ }
+
+ /**
+ * Tears down the fixture, for example, closes a network connection.
+ * This method is called after a test is executed.
+ */
+ protected function tearDown()
+ {
+
+ }
+ public function dataGet_parameter()
+ {
+ return array( array('amount'),
+ array('amount_vat'),
+ array('amount_vat_rate'),
+ array('nd_vat'),
+ array('nd_vat_rate'),
+ array('nd_ded_vat'),
+ array('nd_ded_vat_rate'),
+ array('amount_nd'),
+ array('amount_nd_rate'),
+ array('nd_vat_rate'),
+ array('amount_perso'),
+ array('amount_perso_rate')
+
+ );
+ }
+ /**
+ * @covers Acc_Compute::get_parameter
+ * @todo Implement testGet_parameter().
+ * @dataProvider dataGet_parameter
+ */
+ public function testGet_parameter($data)
+ {
+ $result=$data;
+ $test=$data;
+ $this->assertEquals($test,$result);
+ }
+
+ /**
+ * @covers Acc_Compute::set_parameter
+ * @todo Implement testSet_parameter().
+ */
+ public function testSet_parameter()
+ {
+ $this->assertTrue(true,true);
+ }
+
+ /**
+ * @covers Acc_Compute::get_info
+ * @todo Implement testGet_info().
+ */
+ public function testGet_info()
+ {
+ $this->assertTrue(true,true);
+ }
+
+ /**
+ * @covers Acc_Compute::compute_vat
+ * @todo Implement testCompute_vat().
+ */
+ public function testCompute_vat()
+ {
+ $this->object->set_parameter('amount',1.23);
+ $this->object->set_parameter('amount_vat_rate',0.21);
+ $this->object->compute_vat();
+ $this->assertEquals($this->object->amount_vat,0.26);
+ }
+
+ /**
+ * @covers Acc_Compute::compute_nd
+ * @todo Implement testCompute_nd().
+ */
+ public function testCompute_nd()
+ {
+ $this->object->set_parameter('amount',1.23);
+ $this->object->set_parameter('amount_vat_rate',0.21);
+ $this->object->set_parameter('amount_nd_rate',50);
+ $this->object->check=false;
+ $this->object->compute_nd();
+ $this->assertEquals($this->object->amount_nd,0.62);
+ }
+
+ /**
+ * @covers Acc_Compute::compute_nd_vat
+ * @todo Implement testCompute_nd_vat().
+ */
+ public function testCompute_nd_vat()
+ {
+ $this->object->set_parameter('amount',1.23);
+ $this->object->set_parameter('amount_vat_rate',0.21);
+ $this->object->set_parameter('nd_vat_rate',50);
+ $this->object->check=false;
+ $this->object->compute_nd_vat();
+ $this->assertEquals($this->object->nd_vat,0.13);
+ }
+
+ /**
+ * @covers Acc_Compute::compute_ndded_vat
+ * @todo Implement testCompute_ndded_vat().
+ */
+ public function testCompute_ndded_vat()
+ {
+ $this->object->set_parameter('amount',1.23);
+ $this->object->set_parameter('amount_vat_rate',0.21);
+ $this->object->set_parameter('nd_ded_vat_rate',50);
+ $this->object->check=false;
+ $this->object->compute_ndded_vat();
+ $this->assertEquals($this->object->nd_ded_vat,0.13);
+ }
+
+ /**
+ * @covers Acc_Compute::compute_perso
+ * @todo Implement testCompute_perso().
+ */
+ public function testCompute_perso()
+ {
+ $this->object->set_parameter('amount',1.23);
+ $this->object->set_parameter('amount_vat_rate',0.21);
+ $this->object->set_parameter('amount_perso_rate',50);
+ $this->object->compute_vat();
+ $this->object->compute_perso();
+
+ $this->assertEquals($this->object->amount_perso,0.62);
+ $this->assertEquals($this->object->amount_vat,0.26);
+ }
+
+ /**
+ * @covers Acc_Compute::correct
+ * @todo Implement testCorrect().
+ */
+ public function testCorrect()
+ {
+ $this->object->correct();
+ }
+
+ /**
+ * @covers Acc_Compute::verify
+ * @todo Implement testVerify().
+ */
+ public function testVerify()
+ {
+ $this->object->correct();
+ }
+
+ /**
+ * @covers Acc_Compute::display
+ * @todo Implement testDisplay().
+ * Cannot be checked
+ */
+ public function testDisplay()
+ {
+ $this->object->display();
+ }
+
+ /**
+ * @covers Acc_Compute::test_me
+ * @todo Implement testTest_me().
+ */
+ public function testTest_me()
+ {
+ $this->assertTrue(true,true);
+ }
+
+}