import { FunctionData , ParameterDefinitionData , FunctionCallsData } from 'js-yaml-loader!@/*' ; import { FunctionCallDataStub } from './FunctionCallDataStub' ; export class FunctionDataStub implements FunctionData { public static createWithCode ( ) { return new FunctionDataStub ( ) . withCode ( 'stub-code' ) . withRevertCode ( 'stub-revert-code' ) ; } public static createWithCall ( call ? ) { let instance = new FunctionDataStub ( ) ; if ( call ) { instance = instance . withCall ( call ) ; } else { instance = instance . withMockCall ( ) ; } return instance ; } public static createWithoutCallOrCodes ( ) { return new FunctionDataStub ( ) ; } public name = 'functionDataStub' ; public code : string ; public revertCode : string ; public call ? : FunctionCallsData ; public parameters ? : readonly ParameterDefinitionData [ ] ; private constructor ( ) { } public withName ( name ) { this . name = name ; return this ; } public withParameters ( ... parameters ) { return this . withParametersObject ( parameters ) ; } public withParametersObject ( parameters ) { this . parameters = parameters ; return this ; } public withCode ( code ) { this . code = code ; return this ; } public withRevertCode ( revertCode ) { this . revertCode = revertCode ; return this ; } public withCall ( call ) { this . call = call ; return this ; } public withMockCall ( ) { this . call = new FunctionCallDataStub ( ) ; return this ; } }