ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTestSkillPointAccountTest Class Reference

Class ilTestSkillPointAccountTest. More...

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

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testAddBooking ()
 
 testGetTotalReachedSkillPercent ()
 
- Public Member Functions inherited from ilTestBaseTestCase
 createInstanceOf (string $class_name, array $explicit_parameters=[])
 
 createTraitInstanceOf (string $class_name, array $explicit_parameters=[])
 

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=[])
 
static getNonPublicPropertyValue (object $obj, string $name)
 
- Data Fields inherited from ilTestBaseTestCase
const string MOCKED_METHOD_WITHOUT_OUTPUT = 'MOCKED_METHOD_WITHOUT_OUTPUT'
 
const string DYNAMIC_CLASS = 'DynamicClass'
 
- Protected Attributes inherited from ilTestBaseTestCase
Container $dic = null
 
Container $backup_dic = null
 
- Static Protected Attributes inherited from ilTestBaseTestCase
static int $DYNAMIC_CLASS_COUNT = 0
 

Detailed Description

Member Function Documentation

◆ setUp()

ilTestSkillPointAccountTest::setUp ( )
protected

Reimplemented from ilTestBaseTestCase.

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: