gambas-source-code/.info
2016-09-21 10:28:16 +02:00

506 lines
7.4 KiB
Text

#ATestContainer
C
'This abstract class identifies TestContainer classes. TestContainers are a
'classes that hold different test case methods.
Name
r
s
CaseNames
p
String[]
Case
p
ITestCase
'The current test case
Result
p
TestResult
R
p
TestResult
Debug
p
b
_new
m
[(ShowDebug)b]
RunCase
m
(oCase)ITestCase;(oTestResult)TestResult;
SetupEach
m
TearDownEach
m
SetupContainer
m
TearDownContainer
m
#CRunner
C
Suite
p
TestSuite
_new
m
ShowRunnerForm
m
'Show the Test Runner Form
PrintResult
M
(Res)TestResult;
RunTests
m
(Result)TestResult;[(ContainerName)s(CaseName)s(ShowDebug)b]
'Run all tests, optional limited by Container or TestCaseName. TestResult contains .
GetAllTestContainerNames
M
String[]
#ITest
C
Run
m
(Result)TestResult;[(ShowDebug)b]
CountTestCases
m
i
#ITestCase
ITest
C
Name
r
s
Container
r
ATestContainer
#TestCase
ITestCase
C
'The TestCase class is responsible for executing a specific test case.
'The test case to be executed is specified through the Name and TestContainer
'properties in the class. The Run method will call the appropriate Setup
'and TearDown methods for the test case as well as executing the test case
'method itself.
Name
r
s
'Name of the test case
Container
r
ATestContainer
'Reference to the test container containing the test method to be executed.
_new
m
(sName)s(oTestContainer)ATestContainer;
'Initializes the TestCase. Used in lieu of a constructor.
Run
m
(oTestResult)TestResult;[(ShowDebug)b]
CountTestCases
m
i
#TestError
C
TestCase
p
ITestCase
'Sets a reference to the test case where the error/failure was generated
ErrNumber
p
l
'Set the error number (used by test errors, not failures)
Source
p
s
Description
p
s
#TestErrors
C
'The TestErrors class is the collection class for TestError objects.
'It holds the test case failures and errors that have been collected
'by the TestResult object.
Items
r
TestError[]
_new
m
'Initialize variables
Add
m
TestError
(oTestCase)ITestCase;(lNumber)l(sSource)s(sDescription)s
'Add a new error or failure to the error collection.
Count
r
l
'Return a TestError object from the collection by index - one-based
'Return number of TestError objects in the collection.
#TestParameter
C
Name
p
s
Value
p
v
Parameters
p
TestParameters
#TestParameters
C
_new
m
AddParameter
m
(oParameter)TestParameter;
Add
m
TestParameter
(sName)s(vValue)v
Count
m
l
Item
m
TestParameter
(vIndex)v
#TestResult
C
'The TestResult object collects the results from executing test cases. It is an
'instance of the Collecting Parameter pattern. When new failures or errors
'are added to the TestResult or if a test case is started or finished, the
'TestResult generates events to notify its event handlers about what has happened.
CountRunnedTests
r
i
'Gets the number of run tests.
Failures
r
TestErrors
'Returns a collection of failures
Errors
r
TestErrors
'Returns a collection of errors
Parameters
p
TestParameters
'Set and Returns parameter collection
:AfterStartTest
:
(oTestCase)ITestCase;
'Events
:AfterEndTest
:
:AfterAddError
:
(oError)TestError;
:AfterAddFailure
:
(oError)TestError;
:AfterAddTrace
:
(sMessage)s
_new
m
'Initialize Variables
WasSuccessful
r
b
'Returns whether the entire test was successful or not.
StartTest
m
(oTestCase)ITestCase;
'Informs the result that a test will be started.
EndTest
m
'Informs the result that a test is completed.
AddFailure
m
(sDescription)s
'Adds a failure to the collection of failures.
AddError
m
(lNumber)l(sSource)s(sDescription)s
'Adds a error to the collection of errors.
AddTrace
m
(sMessage)s
'Add trace message
Assert
m
(bCondition)b[(sMessage)s]
'Asserts that a condition is true. If it isn't it raises a failure with the given message.
'bCondition: condition to be asserted
'sMessage: optional message describing the asserted condition
AssertEqualsString
m
(sExpected)s(sActual)s[(sMessage)s]
'Asserts that the expected string equals the actual string.
'sExpected: the expected value
'sActual: the actual value
'sMessage: optional message describing the asserted condition
AssertEqualsLong
m
(lExpected)l(lActual)l[(sMessage)s]
'Asserts that the expected long value equals the actual long value.
'lExpected: the expected value
'lActual: the actual value
'sMessage: optional message describing the asserted condition
AssertEqualsFloat
m
(dExpected)f(dActual)f(dDelta)f[(sMessage)s]
'Asserts that the expected Float value equals the actual Float value with delta precision.
'dExpected: the expected value
'dActual: the actual value
'dDelta: tolerated precision
'sMessage: optional message describing the asserted condition
AssertEqualsVariant
m
(vExpected)v(vActual)v[(sMessage)s]
'Asserts that the expected variant equals the actual variant.
'vExpected: the expected value
'vActual: the actual value
'sMessage: optional message describing the asserted condition
AssertExists
m
(oObject)o[(sMessage)s]
'Asserts that an object is not nothing
'oObject: object reference
'sMessage: the detail message to record if this assertion fails
AssertEqualsObject
m
(oExpected)o(oActual)o[(sMessage)s]
'Asserts that the expected object equals the actual object.
'oExpected: expected object reference
'oActual: actual object reference
'sMessage: the detail message to record if this assertion fails
AssertNotEmpty
m
(vVariant)v[(sMessage)s]
'Asserts that a variant is not empty
'vVariant: variant to evaluate
'sMessage: the detail message to record if this assertion fails
AssertEmpty
m
(vVariant)v[(sMessage)s]
'Asserts that a variant is empty
'vVariant: variant to evaluate
'sMessage: the detail message to record if this assertion fails
AssertNotNull
m
(vVariant)v[(sMessage)s]
'Asserts that a variant is not null
'vVariant: variant to evaluate
'sMessage: the detail message to record if this assertion fails
AssertError
m
(ErrorNumber)l(ErrorMessage)s[(ErrorNumberExpected)l(StrMessage)s]
'Asserts that an error was thrown
'Use it so:
'Try DosomethingThatThrowserror()
'AssertError(Error.Code, Error.Text)
#TestSuite
ITest
C
'The TestSuite class represents a suite of different tests to be run. The TestSuite contains
'a part-whole hierarchy of objects that implement the ITest interface --
'including TestCase objects and other TestSuite objects. Executing the Run method for the
'TestSuite will execute all test cases that it contains. The TestSuite class also provides
'methods for add all test cases contained in a test container object into the suite.
_new
m
Run
m
(oTestResult)TestResult;[(ShowDebug)b]
'Runs all tests contained within the collection and collects the result in the TestResult parameter.
CountTestCases
m
i
'Number of test cases contained in the suite
AddTest
m
(oTest)ITest;
'Add a object implementing ITest (either a TestCase or TestSuite) to the suite.
AddTestCase
m
(oTestCase)ITestCase;
'Add a TestCase to the suite.
AddNewTestCase
m
(sName)s(oTestContainer)ATestContainer;
'Create a new test case and add it to the suite.
AddAllTestCases
m
(oTestContainer)ATestContainer;
'Create all test cases that are contained in the specified TestContainer and add them to the suite.
#_GuTestErrorsAndFailures
ATestContainer
C
TestStringFailure
m
TestLongFailure
m
TestAddError
m
TestAddTrace
m
#_GuTestExample1
ATestContainer
C
SetupEach
m
TeardownEach
m
TestStringNull
m
TestStringOk
m
#_GuTestExample2
ATestContainer
C
SetupContainer
m
TeardownContainer
m
SetupEach
m
TeardownEach
m
TestFirstTest
m
TestThirdTest
m
TestSecondTest
m
#_GuTestIntentionalError
ATestContainer
C
TestError
m