|
ColdBox Platform Version 2.6.4 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
coldbox.system.testing.mockutils.MockGenerator
public class MockGenerator
The guy in charge of creating mocks
| Constructor Summary | |
|---|---|
init(MockBox mockBox)
Constructor |
|
| Method Summary | |
|---|---|
private void |
$include(string templatePath)
Mix in a template |
string |
generate(string method, [any returns], boolean preserveReturnType='true', [boolean throwException='false'], [string throwType=''], [string throwDetail=''], [string throwMessage=''], any metadata='', any targetObject, [boolean callLogging='false'])
Generate a mock method and return the generated path |
private MockBox |
getmockBox()
|
boolean |
removeStub(string genPath)
Remove a method generator stub |
void |
writeStub(string genPath, string code)
Write a method generator stub |
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Constructor Detail |
|---|
public init(MockBox mockBox)
mockBox| Method Detail |
|---|
private void $include(string templatePath)
templatePathpublic string generate(string method, [any returns], boolean preserveReturnType='true', [boolean throwException='false'], [string throwType=''], [string throwDetail=''], [string throwMessage=''], any metadata='', any targetObject, [boolean callLogging='false'])
method - The method you want to mock or spy onreturns - The results it must return, if not passed it returns void or you will have to do the mockResults() chainpreserveReturnType - If false, the mock will make the returntype of the method equal to ANYthrowException - If you want the method call to throw an exceptionthrowType - The type of the exception to throwthrowDetail - The detail of the exception to throwthrowMessage - The message of the exception to throwmetadata - The function metadatatargetObject - The target object to mix incallLogging - Will add the machinery to also log the incoming arguments to each subsequent calls to this methodprivate MockBox getmockBox()
public boolean removeStub(string genPath)
genPathpublic void writeStub(string genPath, string code)
genPathcode
|
ColdBox Platform Version 2.6.4 | ||||
| FRAMES | |||||