testutil

package
v1.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetArgs

func GetArgs(v interface{}) ([]interface{}, bool)

GetArgs returns the arguments from teh given mock function invocation. If the given parameter is not of the required type, a false-valued flag is returned.

Types

type CallInstance

type CallInstance interface {
	Args() []interface{}
	Results() []interface{}
}

CallInstance holds the arguments and results of a single mock function call.

func GetCallHistory

func GetCallHistory(v interface{}) ([]CallInstance, bool)

GetCallHistory extracts the history from the given mock function and returns the set of call instances.

func GetCallHistoryWith

func GetCallHistoryWith(v interface{}, matcher func(v CallInstance) bool) (matching []CallInstance, _ bool)

GetCallHistoryWith extracts the history from the given mock function and returns the set of call instances that match the given function. If the given parameter is not of the required type, a false-valued flag is returned.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL