-
Notifications
You must be signed in to change notification settings - Fork 3
Mock
Lieven De Foor edited this page Aug 23, 2017
·
11 revisions
The Mock class is used for creating a mock test double. A Mock object extends the basic shell functionality of a Stub double, and allows you to specify expectations regarding how many times, and with what parameter values, a method, function or procedure should be called.
-
VOID
AssertIsSatisfied()- This method looks at all expectations that have been set on a Mock object, and asserts whether each expectation has been met. If not, an assertion error is raised for trapping by the OEUnit framework.
-
VOID
AddProcedureParameter(INPUT paramType AS CHARACTER, INPUT nam AS CHARACTER, INPUT dType AS CHARACTER)- This method specifies a parameter to be created in the Main Block of a procedure file, as a work-around for a known issue when extracting data from a procedure file (see Work Arounds for OpenEdge Limitations in the Basic Usage information).
- Parameter: paramType (CHARACTER) - Specifies whether the parameter is an INPUT, OUTPUT or INPUT-OUTPUT parameter.
- Parameter: nam (CHARACTER) - Specifies the name of the parameter.
- Parameter: dType (CHARACTER) - Specifies the data type of the parameter.
-
VOID
AddProcedureBufferParameter(INPUT nam AS CHARACTER, INPUT tabl AS CHARACTER)- This method specifies a buffer parameter to be created in the Main Block of a procedure file, as a work-around for a known issue when extracting data from a procedure file (see Work Arounds for OpenEdge Limitations in the Basic Usage information).
- Parameter: nam (CHARACTER) - Specifies the name of the parameter.
- Parameter: tabl (CHARACTER) - Specifies the name of the table to create the buffer parameter for.
-
VOID
AddProcedureDataSetParameter(INPUT nam AS CHARACTER)- This method specifies a ProDataSet parameter to be created in the Main Block of a procedure file, as a work-around for a known issue when extracting data from a procedure file (see Work Arounds for OpenEdge Limitations in the Basic Usage information).
- Parameter: nam (CHARACTER) - Specifies the name of the ProDataSet to create the parameter for.
-
VOID
AddTempTable(INPUT ttHandle AS HANDLE)- This method specifies a handle to a temp-table which should be inserted into the Main Block or within the Class definition of the mocked procedure file or class (see Work Arounds for OpenEdge Limitations in the Basic Usage information).
- Parameter: ttHandle (HANDLE) - Specifies the handle of the temp-table to add. The temp-table, field and index details will be analysed and replicated in the mocked file.
-
OEMock.Expectation.Expectation
Expect(INPUT methName AS CHARACTER)- This method creates a new Expectation object, adds it to the list of expectations that a Mock object has, and returns the Expectation object so that expectation parameters can be set.
- Returns an object of type OEMock.Expectation.Expecation
- Parameter: methName (CHARACTER) - The name of the class method, procedure or function that the Mock object should assert the expectation on should be given in parameter
methName
.
-
VOID
SetFunctionOutputParameterValue(INPUT funcName AS CHARACTER, INPUT paramName AS CHARACTER, INPUT paramReturnValue AS CHARACTER)- This method sets the value of an output parameter in a named function
- Parameter: funcName (CHARACTER) - The name of the function to set the output parameter value for
- Parameter: paramName (CHARACTER) - The name of the output parameter to set
- Parameter: paramReturnValue (CHARACTER) - The desired output value for the parameter
-
VOID
SetFunctionReturnValue(INPUT funcName AS CHARACTER, INPUT retValue AS CHARACTER)- This method sets the return value of a named function to the specified value.
- Parameter: funcName (CHARACTER) - The name of the function to set the return value for
- Parameter: retValue (CHARACTER) - The desired return value for the function
-
VOID
SetMethodOutputParameterValue(INPUT methName AS CHARACTER, INPUT paramName AS CHARACTER, INPUT paramReturnValue AS CHARACTER)- This method sets the value of an output parameter in a named class method
- Parameter: methName (CHARACTER) - The name of the class method to set the output parameter value for
- Parameter: paramName (CHARACTER) - The name of the output parameter to set
- Parameter: paramReturnValue (CHARACTER) - The desired output value for the parameter
-
VOID
SetMethodReturnValue(INPUT methName AS CHARACTER, INPUT retValue AS CHARACTER)- This method sets the return value of a named class method to the specified value.
- Parameter: methName (CHARACTER) - The name of the class method to set the return value for
- Parameter: retValue (CHARACTER) - The desired return value for the class method
-
VOID
SetProcedureOutputParameterValue(INPUT procName AS CHARACTER, INPUT paramName AS CHARACTER, INPUT paramReturnValue AS CHARACTER)- This method sets the value of an output parameter in a named procedure
- Parameter: procName (CHARACTER) - The name of the procedure to set the output parameter value for
- Parameter: paramName (CHARACTER) - The name of the output parameter to set
- Parameter: paramReturnValue (CHARACTER) - The desired output value for the parameter
-
LOGICAL
CompileOnGenerate - IfTRUE
, the mocked file will be compiled whenever it is generated.