mockrt

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mockrt provides mock runtime for mockgo

Index

Constants

This section is empty.

Variables

View Source
var IgnoreContext = cmpopts.IgnoreInterfaces(struct{ context.Context }{})

IgnoreContext is an option to ignore context.Context.

Functions

This section is empty.

Types

type Call

type Call struct {
	Parameter interface{}
	Result    interface{}
}

Call defines pair of request and response parameters for a method call.

type Sequence

type Sequence struct {
	// contains filtered or unexported fields
}

Sequence is a checker of sequence of method calls

func NewQ

func NewQ(t *testing.T, calls ...Call) *Sequence

NewQ is an alias for NewSequence, creates a sequence of calls. This is called by test codes.

func NewSequence

func NewSequence(t *testing.T, calls ...Call) *Sequence

NewSequence creates a sequence of calls. This is called by test codes.

func (*Sequence) AddCall

func (s *Sequence) AddCall(calls ...Call) *Sequence

AddCall adds call data. This is called by test codes.

func (*Sequence) Call

func (s *Sequence) Call(name string, param interface{}) interface{}

Call checks call parameter and returns result. This is called by mock code.

func (*Sequence) IsEnd

func (s *Sequence) IsEnd()

IsEnd checks sequence has end or not. This is called by test code.

func (*Sequence) T

func (s *Sequence) T() *testing.T

T returns *testing.T. This is called by mock code.

func (*Sequence) WithOption

func (s *Sequence) WithOption(opts ...cmp.Option) *Sequence

WithOption updates compare option. This is called by test codes.

Jump to

Keyboard shortcuts

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