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

Class ilTestParticipantScoringTest. More...

+ Inheritance diagram for ilTestParticipantScoringTest:
+ Collaboration diagram for ilTestParticipantScoringTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testActiveId ()
 
 testScoredPass ()
 
 testAnsweredQuestions ()
 
 testTotalQuestions ()
 
 testReachedPoints ()
 
 testMaxPoints ()
 
 testPassed ()
 
 testFinalMark ()
 
 testGetPercentResult ()
 
- 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

ilTestParticipantScoring $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()

ilTestParticipantScoringTest::setUp ( )
protected

Reimplemented from ilTestBaseTestCase.

Definition at line 29 of file ilTestParticipantScoringTest.php.

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

◆ test_instantiateObject_shouldReturnInstance()

ilTestParticipantScoringTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 36 of file ilTestParticipantScoringTest.php.

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

◆ testActiveId()

ilTestParticipantScoringTest::testActiveId ( )

Definition at line 41 of file ilTestParticipantScoringTest.php.

41 : void
42 {
43 $activeId = 210;
44 $this->testObj->setActiveId($activeId);
45 $this->assertEquals($activeId, $this->testObj->getActiveId());
46 }

◆ testAnsweredQuestions()

ilTestParticipantScoringTest::testAnsweredQuestions ( )

Definition at line 55 of file ilTestParticipantScoringTest.php.

55 : void
56 {
57 $answeredQuestions = 210;
58 $this->testObj->setAnsweredQuestions($answeredQuestions);
59 $this->assertEquals($answeredQuestions, $this->testObj->getAnsweredQuestions());
60 }

◆ testFinalMark()

ilTestParticipantScoringTest::testFinalMark ( )

Definition at line 92 of file ilTestParticipantScoringTest.php.

92 : void
93 {
94 $finalMark = 'testString';
95 $this->testObj->setFinalMark($finalMark);
96 $this->assertEquals($finalMark, $this->testObj->getFinalMark());
97 }

◆ testGetPercentResult()

ilTestParticipantScoringTest::testGetPercentResult ( )

Definition at line 99 of file ilTestParticipantScoringTest.php.

99 : void
100 {
101 $this->assertEquals(0, $this->testObj->getPercentResult());
102
103 $maxPoints = 20;
104 $reachedPoints = 12;
105 $this->testObj->setMaxPoints($maxPoints);
106 $this->testObj->setReachedPoints($reachedPoints);
107 $this->assertEquals($reachedPoints / $maxPoints, $this->testObj->getPercentResult());
108 }

◆ testMaxPoints()

ilTestParticipantScoringTest::testMaxPoints ( )

Definition at line 76 of file ilTestParticipantScoringTest.php.

76 : void
77 {
78 $maxPoints = 210;
79 $this->testObj->setMaxPoints($maxPoints);
80 $this->assertEquals($maxPoints, $this->testObj->getMaxPoints());
81 }

◆ testPassed()

ilTestParticipantScoringTest::testPassed ( )

Definition at line 83 of file ilTestParticipantScoringTest.php.

83 : void
84 {
85 $this->testObj->setPassed(false);
86 $this->assertFalse($this->testObj->isPassed());
87
88 $this->testObj->setPassed(true);
89 $this->assertTrue($this->testObj->isPassed());
90 }

◆ testReachedPoints()

ilTestParticipantScoringTest::testReachedPoints ( )

Definition at line 69 of file ilTestParticipantScoringTest.php.

69 : void
70 {
71 $reachedPoints = 210;
72 $this->testObj->setReachedPoints($reachedPoints);
73 $this->assertEquals($reachedPoints, $this->testObj->getReachedPoints());
74 }

◆ testScoredPass()

ilTestParticipantScoringTest::testScoredPass ( )

Definition at line 48 of file ilTestParticipantScoringTest.php.

48 : void
49 {
50 $scoredPass = 210;
51 $this->testObj->setScoredPass($scoredPass);
52 $this->assertEquals($scoredPass, $this->testObj->getScoredPass());
53 }

◆ testTotalQuestions()

ilTestParticipantScoringTest::testTotalQuestions ( )

Definition at line 62 of file ilTestParticipantScoringTest.php.

62 : void
63 {
64 $totalQuestions = 210;
65 $this->testObj->setTotalQuestions($totalQuestions);
66 $this->assertEquals($totalQuestions, $this->testObj->getTotalQuestions());
67 }

Field Documentation

◆ $testObj

ilTestParticipantScoring ilTestParticipantScoringTest::$testObj
private

Definition at line 27 of file ilTestParticipantScoringTest.php.


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