Documentation ¶
Overview ¶
* Copyright 2022 ByteDance Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2022 ByteDance Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- func GetNestedMethod(instance interface{}, methodName string) (interface{}, bool)
- func GetPrivateFunc(m interface{}) (r interface{})
- func MakeAOP(funcName string, mockRender *StatementRender, m interface{}) (fun interface{})
- func MakeCall(ctx context.Context, funcName string, mockRender *StatementRender, ...) (fun interface{})
- func OverPassMakeCall(ctx context.Context, funcName string, mockRender *StatementRender, ...) (fun interface{})
- type StatementRender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNestedMethod ¶
func GetPrivateFunc ¶
func GetPrivateFunc(m interface{}) (r interface{})
func MakeAOP ¶
func MakeAOP(funcName string, mockRender *StatementRender, m interface{}) (fun interface{})
func MakeCall ¶
func MakeCall(ctx context.Context, funcName string, mockRender *StatementRender, m interface{}, useMockType int) (fun interface{})
TODO(siwei.wang): alias will make MakeCall panic.
func OverPassMakeCall ¶
func OverPassMakeCall(ctx context.Context, funcName string, mockRender *StatementRender, m interface{}) (fun interface{})
Types ¶
type StatementRender ¶
type StatementRender struct { MockStatement []string TestFuncCall []string AssertStatement []string Imports []string MonkeyOutputMap variablecard.MonkeyOutputMap UsedMockFunc map[string]int }