ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestSkillPointAccountTest Class Reference

Class ilTestSkillPointAccountTest. More...

+ Inheritance diagram for ilTestSkillPointAccountTest:
+ Collaboration diagram for ilTestSkillPointAccountTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testAddBooking ()
 
 testGetTotalReachedSkillPercent ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ilTestBaseTestCase
 setUp ()
 
 tearDown ()
 

Private Attributes

ilTestSkillPointAccount $testObj
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTestBaseTestCase
static callMethod ($obj, $name, array $args=[])
 
- Protected Attributes inherited from ilTestBaseTestCase
Container $dic = null
 

Detailed Description

Member Function Documentation

◆ setUp()

ilTestSkillPointAccountTest::setUp ( )
protected

Definition at line 29 of file ilTestSkillPointAccountTest.php.

29  : void
30  {
31  parent::setUp();
32 
33  $this->testObj = new ilTestSkillPointAccount();
34  }

◆ test_instantiateObject_shouldReturnInstance()

ilTestSkillPointAccountTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 36 of file ilTestSkillPointAccountTest.php.

36  : void
37  {
38  $this->assertInstanceOf(ilTestSkillPointAccount::class, $this->testObj);
39  }

◆ testAddBooking()

ilTestSkillPointAccountTest::testAddBooking ( )

Definition at line 41 of file ilTestSkillPointAccountTest.php.

41  : void
42  {
43  $maxSkillPoints1 = 80;
44  $reachedSkillPoints1 = 20;
45  $this->testObj->addBooking($maxSkillPoints1, $reachedSkillPoints1);
46  $this->assertEquals($maxSkillPoints1, $this->testObj->getTotalMaxSkillPoints());
47  $this->assertEquals($reachedSkillPoints1, $this->testObj->getTotalReachedSkillPoints());
48 
49  $maxSkillPoints2 = 50;
50  $reachedSkillPoints2 = 10;
51  $this->testObj->addBooking($maxSkillPoints2, $reachedSkillPoints2);
52  $this->assertEquals($maxSkillPoints1 + $maxSkillPoints2, $this->testObj->getTotalMaxSkillPoints());
53  $this->assertEquals($reachedSkillPoints1 + $reachedSkillPoints2, $this->testObj->getTotalReachedSkillPoints());
54  }

◆ testGetTotalReachedSkillPercent()

ilTestSkillPointAccountTest::testGetTotalReachedSkillPercent ( )

Definition at line 56 of file ilTestSkillPointAccountTest.php.

56  : void
57  {
58  $maxSkillPoints1 = 80;
59  $reachedSkillPoints1 = 20;
60  $maxSkillPoints2 = 20;
61  $reachedSkillPoints2 = 30;
62 
63  $this->testObj->addBooking($maxSkillPoints1, $reachedSkillPoints1);
64  $this->testObj->addBooking($maxSkillPoints2, $reachedSkillPoints2);
65  $this->assertEquals(($reachedSkillPoints1 + $reachedSkillPoints2) / ($maxSkillPoints1 + $maxSkillPoints2) * 100, $this->testObj->getTotalReachedSkillPercent());
66  }

Field Documentation

◆ $testObj

ilTestSkillPointAccount ilTestSkillPointAccountTest::$testObj
private

Definition at line 27 of file ilTestSkillPointAccountTest.php.


The documentation for this class was generated from the following file: