ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
assNumericRangeTest Class Reference

Unit tests. 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 Attributes

 $backupGlobals = FALSE

Detailed Description

Unit tests.

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

Definition at line 11 of file assNumericRangeTest.php.

Member Function Documentation

assNumericRangeTest::setUp ( )
protected

Definition at line 15 of file assNumericRangeTest.php.

{
if (defined('ILIAS_PHPUNIT_CONTEXT'))
{
include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
ilUnitUtil::performInitialisation();
}
else
{
chdir( dirname( __FILE__ ) );
chdir('../../../');
}
}
assNumericRangeTest::test_contains_shouldReturnFalseIfValueIsHokum ( )

Definition at line 132 of file assNumericRangeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
$instance = new assNumericRange();
$instance->setLowerLimit(1.00);
$instance->setUpperLimit(10.00);
$expected = false;
// Act
$actual = $instance->contains('Günther');
// Assert
$this->assertEquals($expected, $actual);
}
assNumericRangeTest::test_contains_shouldReturnFalseIfValueIsNotContained ( )

Definition at line 116 of file assNumericRangeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
$instance = new assNumericRange();
$instance->setLowerLimit(1.00);
$instance->setUpperLimit(10.00);
$expected = false;
// Act
$actual = $instance->contains(15.00);
// Assert
$this->assertEquals($expected, $actual);
}
assNumericRangeTest::test_contains_shouldReturnTrueIfValueIsContained ( )

Definition at line 100 of file assNumericRangeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
$instance = new assNumericRange();
$instance->setLowerLimit(1.00);
$instance->setUpperLimit(10.00);
$expected = true;
// Act
$actual = $instance->contains(5.00);
// Assert
$this->assertEquals($expected, $actual);
}
assNumericRangeTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 29 of file assNumericRangeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
// Act
$instance = new assNumericRange();
$this->assertInstanceOf('assNumericRange', $instance);
}
assNumericRangeTest::test_setGetLowerLimit_shouldReturnUnchangedLowerLimit ( )

Definition at line 40 of file assNumericRangeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
$instance = new assNumericRange();
$expected = 1.00;
// Act
$instance->setLowerLimit($expected);
$actual = $instance->getLowerLimit();
// Assert
$this->assertEquals($expected, $actual);
}
assNumericRangeTest::test_setGetOrder_shouldReturnUnchangedOrder ( )

Definition at line 70 of file assNumericRangeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
$instance = new assNumericRange();
$expected = 10;
// Act
$instance->setOrder($expected);
$actual = $instance->getOrder();
// Assert
$this->assertEquals($expected, $actual);
}
assNumericRangeTest::test_setGetUpperLimit_shouldReturnUnchangedUpperLimit ( )

Definition at line 55 of file assNumericRangeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
$instance = new assNumericRange();
$expected = 10.00;
// Act
$instance->setUpperLimit($expected);
$actual = $instance->getUpperLimit();
// Assert
$this->assertEquals($expected, $actual);
}
assNumericRangeTest::test_setPoints_shouldReturnUnchangedPoints ( )

Definition at line 85 of file assNumericRangeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assNumericRange.php';
$instance = new assNumericRange();
$expected = 10;
// Act
$instance->setPoints($expected);
$actual = $instance->getPoints();
// Assert
$this->assertEquals($expected, $actual);
}

Field Documentation

assNumericRangeTest::$backupGlobals = FALSE
protected

Definition at line 13 of file assNumericRangeTest.php.


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