ILIAS  release_8 Revision v8.24
assNumericRangeTest.php
Go to the documentation of this file.
1<?php
2
27{
28 protected $backupGlobals = false;
29
30 protected function setUp(): void
31 {
32 chdir(dirname(__FILE__));
33 chdir('../../../');
34 }
35
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 }
46
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 }
61
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 }
76
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 }
91
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 }
106
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 }
122
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 }
138
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 }
154}
Class assBaseTestCase.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
test_setGetLowerLimit_shouldReturnUnchangedLowerLimit()
test_setGetUpperLimit_shouldReturnUnchangedUpperLimit()
test_contains_shouldReturnFalseIfValueIsNotContained()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...