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

Unit tests for ASS_Mark. More...

+ Inheritance diagram for ilassMarkTest:
+ Collaboration diagram for ilassMarkTest:

Public Member Functions

 testGetSetShortName ()
 Basic Get/Set test on member short name using accessor methods.
 testGetSetPassed ()
 Basic Get/Set test on member passed using accessor methods.
 testGetSetOfficialName ()
 Basic Get/Set test on member officialName using accessor methods.
 testGetSetMinimumLevel ()
 Basic Get/Set test on member minimumLevel using accessor methods.
 testSetMinimumLevel_High ()
 Set test on member minimumLevel using accessor method with a high level.
 testSetMinimumLevel_Low ()
 Set test on member minimumLevel using accessor methods with a very low level.
 testSetMinimumLevel_TooLow ()
 Set test on member minimumLevel using accessor methods with a too low level.

Protected Member Functions

 setUp ()

Protected Attributes

 $backupGlobals = FALSE
 $ass_mark

Detailed Description

Unit tests for ASS_Mark.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
Id:
ilassMarkTest.php 44198 2013-08-15 14:54:18Z mbecker

Definition at line 13 of file ilassMarkTest.php.

Member Function Documentation

ilassMarkTest::setUp ( )
protected

Definition at line 21 of file ilassMarkTest.php.

{
if (defined('ILIAS_PHPUNIT_CONTEXT'))
{
require_once './Services/PHPUnit/classes/class.ilUnitUtil.php';
ilUnitUtil::performInitialisation();
}
else
{
chdir( dirname( __FILE__ ) );
chdir('../../../');
}
// Arrange
require_once './Modules/Test/classes/class.assMark.php';
$this->ass_mark = new ASS_Mark();
}
ilassMarkTest::testGetSetMinimumLevel ( )

Basic Get/Set test on member minimumLevel using accessor methods.

Definition at line 102 of file ilassMarkTest.php.

{
// Arrange
$expected = 50;
$this->ass_mark->setMinimumLevel($expected);
// Act
$actual = $this->ass_mark->getMinimumLevel();
// Assert
$this->assertEquals(
$actual,
$expected,
"Get/Set on minimumLevel failed, in/out not matching."
);
}
ilassMarkTest::testGetSetOfficialName ( )

Basic Get/Set test on member officialName using accessor methods.

Definition at line 82 of file ilassMarkTest.php.

{
// Arrange
$expected = "Esther The Tester";
$this->ass_mark->setOfficialName($expected);
// Act
$actual = $this->ass_mark->getOfficialName();
// Assert
$this->assertEquals(
$actual,
$expected,
"Get/Set on officialName failed, in/out not matching."
);
}
ilassMarkTest::testGetSetPassed ( )

Basic Get/Set test on member passed using accessor methods.

Definition at line 62 of file ilassMarkTest.php.

{
// Arrange
$expected = 1;
$this->ass_mark->setPassed($expected);
// Act
$actual = $this->ass_mark->getPassed();
// Assert
$this->assertEquals(
$actual,
$expected,
"Get/Set on passed failed, in/out not matching."
);
}
ilassMarkTest::testGetSetShortName ( )

Basic Get/Set test on member short name using accessor methods.

Definition at line 42 of file ilassMarkTest.php.

{
// Arrange
$expected = "Esther";
$this->ass_mark->setShortName($expected);
// Act
$actual = $this->ass_mark->getShortName();
// Assert
$this->assertEquals(
$actual,
$expected,
"Get/Set on shortName failed, in/out not matching."
);
}
ilassMarkTest::testSetMinimumLevel_High ( )

Set test on member minimumLevel using accessor method with a high level.

Tested method should accept double according to docblock at getMinimumLevel(). Confusingly, setMinimumLevel states that it accepts strings as param, which can be considered an oversight of the author.

Todo:

Enhance documentation of class.assMark.php::setMinimumLevel();

Enhance documentation of class.assMark.php::getMinimumLevel();

Definition at line 131 of file ilassMarkTest.php.

{
// Arrange
$expected = 100;
$this->ass_mark->setMinimumLevel($expected);
// Act
$actual = $this->ass_mark->getMinimumLevel();
// Assert
$this->assertEquals(
$actual,
$expected,
"Set low on minimumLevel failed, in/out not matching."
);
}
ilassMarkTest::testSetMinimumLevel_Low ( )

Set test on member minimumLevel using accessor methods with a very low level.

See Also
testSetMinimumLevel_High()

Definition at line 154 of file ilassMarkTest.php.

{
// Arrange
$expected = 1E-14;
$this->ass_mark->setMinimumLevel($expected);
// Act
$actual = $this->ass_mark->getMinimumLevel();
// Assert
$this->assertEquals(
$actual,
$expected,
"Set low on minimumLevel failed, in/out not matching."
);
}
ilassMarkTest::testSetMinimumLevel_TooLow ( )

Set test on member minimumLevel using accessor methods with a too low level.

Exception

See Also
testSetMinimumLevel_High()

Definition at line 178 of file ilassMarkTest.php.

{
// Arrange
$expected = -1;
$this->ass_mark->setMinimumLevel($expected);
// Act
$actual = $this->ass_mark->getMinimumLevel();
}

Field Documentation

ilassMarkTest::$ass_mark
protected

Definition at line 19 of file ilassMarkTest.php.

ilassMarkTest::$backupGlobals = FALSE
protected

Definition at line 16 of file ilassMarkTest.php.


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