mn8 Language Reference | Index    

TestSuite

SUMMARY: NO ATTRIBUTES  ELEMENTS SUMMARY  CONSTRUCTORS SUMMARY  NO OPERATORS  METHODS SUMMARYDETAIL: NO ATTRIBUTES  ELEMENT DETAILS  CONSTRUCTOR DETAILS  NO OPERATORS  METHOD DETAILS

Description

A TestSuite is a Composite of Tests. It runs a collection of test cases.

Usage

An example using the dynamic test definition.

            $suite typeof TestSuite()
            $mathTest typeof MathTest
            $suite.addTest( $mathTest )

Alternatively, a TestSuite can extract the tests to be run automatically. To do so you pass the concept of your TestCase concept to the TestSuite constructor.

            $mathTest typeof MathTest
            $suite typeof TestSuite( $mathTest )

This constructor creates a suite with all the methods starting with "test" and return String that take no arguments.

Version: 0.1
Authors:Antal Attila ()
Location:
Inherits: Concept, Test

Element List

 fTests TYPEOF Series LABEL "fTests"
 fName TYPEOF String LABEL "fName"
top

Constructor List

create (String $name)
create (Concept $theConcept)
top

Method List

addTest (Test $test)
addTestMethod (Method $m, Series $names, Method $constructor)
addTestSuite (Concept $testC)
IntegercountTestCases
LogicalisTestMethod (Method $m)
run (TestResult $result)
runTest (Test $test, TestResult $result)
setName (String $name)
TesttestAt (Integer $index)
IntegertestCount
Seriestests
StringtoString
Testwarning (String $msg)
top
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI
Methods inherited from: Test
countTestCases, run

Detailed Element Info

fTests

Label:fTests
Type:Series
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:true

This series element will hold the Tests

top

fName

Label:fName
Type:String
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:true

The name of the test suite

top

Detailed Constructor Info

create (String $name)
Parameters:
$name :

Constructs an empty TestSuite the with name.

top
create (Concept $theConcept)
Parameters:
$theConcept :

Cnstructs a TestSuite from the given concept. Adds all the methods starting with "test" and returns String as test cases to the suite.

top

Detailed Method Info

addTest (Test $test)
Parameters:
$test :
Returns:

Adds a test to the suite.

top
addTestMethod (Method $m, Series $names, Method $constructor)
Parameters:
$m :
$names :
$constructor :
Returns:

Adds a test method

top
addTestSuite (Concept $testC)
Parameters:
$testC :
Returns:

Adds the tests from the given concept to the suite

top
countTestCases
Returns: Integer

Counts the number of test cases that will be run by this test.

top
isTestMethod (Method $m)
Parameters:
$m :Test Method
Returns: Logical

Verify if the passed method is test method. The method name must start with "test" andt must return a String.

top
run (TestResult $result)
Parameters:
$result :
Returns:

Runs the tests and collects their result in a TestResult. Specified by: run in interface Test

top
runTest (Test $test, TestResult $result)
Parameters:
$test :
$result :
Returns:

Runs the tests and collects their result in a TestResult.

top
setName (String $name)
Parameters:
$name :Suite name
Returns:

Sets the name of the suite.

top
testAt (Integer $index)
Parameters:
$index :
Returns: Test

Returns the test at the given index

top
testCount
Returns: Integer

Returns the number of tests in this suite

top
tests
Returns: Series

Returns the tests as a Series

top
toString
Returns: String

Returns the name of the suite. Not all test suites have a name.

top
warning (String $msg)
Parameters:
$msg :
Returns: Test

Shows a warning message. Use the TestCase warning Adapter.

top