ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
assNumericRangeTest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for assNumericRangeTest:
+ Collaboration diagram for assNumericRangeTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 test_setGetLowerLimit_shouldReturnUnchangedLowerLimit ()
 
 test_setGetUpperLimit_shouldReturnUnchangedUpperLimit ()
 
 test_setGetOrder_shouldReturnUnchangedOrder ()
 
 test_setPoints_shouldReturnUnchangedPoints ()
 
 test_contains_shouldReturnTrueIfValueIsContained ()
 
 test_contains_shouldReturnFalseIfValueIsNotContained ()
 
 test_contains_shouldReturnFalseIfValueIsHokum ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from assBaseTestCase
 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, $value)
 
 getGlobalTemplateMock ()
 
 getDatabaseMock ()
 
 getIliasMock ()
 

Protected Attributes

 $backupGlobals = false
 
- Protected Attributes inherited from assBaseTestCase
Container $dic = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Unit tests

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de

Definition at line 26 of file assNumericRangeTest.php.

Member Function Documentation

◆ setUp()

assNumericRangeTest::setUp ( )
protected

Definition at line 30 of file assNumericRangeTest.php.

30  : void
31  {
32  chdir(dirname(__FILE__));
33  chdir('../../../');
34  }

◆ test_contains_shouldReturnFalseIfValueIsHokum()

assNumericRangeTest::test_contains_shouldReturnFalseIfValueIsHokum ( )

Definition at line 139 of file assNumericRangeTest.php.

139  : void
140  {
141  // Arrange
142  require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
143  $instance = new assNumericRange();
144  $instance->setLowerLimit(1.00);
145  $instance->setUpperLimit(10.00);
146  $expected = false;
147 
148  // Act
149  $actual = $instance->contains('Günther');
150 
151  // Assert
152  $this->assertEquals($expected, $actual);
153  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_contains_shouldReturnFalseIfValueIsNotContained()

assNumericRangeTest::test_contains_shouldReturnFalseIfValueIsNotContained ( )

Definition at line 123 of file assNumericRangeTest.php.

123  : void
124  {
125  // Arrange
126  require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
127  $instance = new assNumericRange();
128  $instance->setLowerLimit(1.00);
129  $instance->setUpperLimit(10.00);
130  $expected = false;
131 
132  // Act
133  $actual = $instance->contains(15.00);
134 
135  // Assert
136  $this->assertEquals($expected, $actual);
137  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_contains_shouldReturnTrueIfValueIsContained()

assNumericRangeTest::test_contains_shouldReturnTrueIfValueIsContained ( )

Definition at line 107 of file assNumericRangeTest.php.

107  : void
108  {
109  // Arrange
110  require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
111  $instance = new assNumericRange();
112  $instance->setLowerLimit(1.00);
113  $instance->setUpperLimit(10.00);
114  $expected = true;
115 
116  // Act
117  $actual = $instance->contains(5.00);
118 
119  // Assert
120  $this->assertEquals($expected, $actual);
121  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_instantiateObject_shouldReturnInstance()

assNumericRangeTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 36 of file assNumericRangeTest.php.

36  : void
37  {
38  // Arrange
39  require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
40 
41  // Act
42  $instance = new assNumericRange();
43 
44  $this->assertInstanceOf('assNumericRange', $instance);
45  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setGetLowerLimit_shouldReturnUnchangedLowerLimit()

assNumericRangeTest::test_setGetLowerLimit_shouldReturnUnchangedLowerLimit ( )

Definition at line 47 of file assNumericRangeTest.php.

47  : void
48  {
49  // Arrange
50  require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
51  $instance = new assNumericRange();
52  $expected = 1.00;
53 
54  // Act
55  $instance->setLowerLimit($expected);
56  $actual = $instance->getLowerLimit();
57 
58  // Assert
59  $this->assertEquals($expected, $actual);
60  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setGetOrder_shouldReturnUnchangedOrder()

assNumericRangeTest::test_setGetOrder_shouldReturnUnchangedOrder ( )

Definition at line 77 of file assNumericRangeTest.php.

77  : void
78  {
79  // Arrange
80  require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
81  $instance = new assNumericRange();
82  $expected = 10;
83 
84  // Act
85  $instance->setOrder($expected);
86  $actual = $instance->getOrder();
87 
88  // Assert
89  $this->assertEquals($expected, $actual);
90  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setGetUpperLimit_shouldReturnUnchangedUpperLimit()

assNumericRangeTest::test_setGetUpperLimit_shouldReturnUnchangedUpperLimit ( )

Definition at line 62 of file assNumericRangeTest.php.

62  : void
63  {
64  // Arrange
65  require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
66  $instance = new assNumericRange();
67  $expected = 10.00;
68 
69  // Act
70  $instance->setUpperLimit($expected);
71  $actual = $instance->getUpperLimit();
72 
73  // Assert
74  $this->assertEquals($expected, $actual);
75  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setPoints_shouldReturnUnchangedPoints()

assNumericRangeTest::test_setPoints_shouldReturnUnchangedPoints ( )

Definition at line 92 of file assNumericRangeTest.php.

92  : void
93  {
94  // Arrange
95  require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
96  $instance = new assNumericRange();
97  $expected = 10;
98 
99  // Act
100  $instance->setPoints($expected);
101  $actual = $instance->getPoints();
102 
103  // Assert
104  $this->assertEquals($expected, $actual);
105  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Field Documentation

◆ $backupGlobals

assNumericRangeTest::$backupGlobals = false
protected

Definition at line 28 of file assNumericRangeTest.php.


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