mockrt3

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 mockrt3 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 C

type C struct {
	P P
	R R
}

C defines pair of request parameter (P) and response result (R) for a method call.

type P

type P interface{ P__() }

P is a trait for types of request parameter.

type Q

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

Q is a checker of sequence of method calls

func NewQ

func NewQ(t *testing.T, calls ...C) *Q

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

func (*Q) AddCall

func (q *Q) AddCall(calls ...C) *Q

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

func (*Q) Call

func (q *Q) Call(name string, param P) R

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

func (*Q) IsEnd

func (q *Q) IsEnd()

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

func (*Q) T

func (q *Q) T() *testing.T

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

func (*Q) WithOption

func (q *Q) WithOption(opts ...cmp.Option) *Q

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

type R

type R interface{ R__() }

R is a trait for types of response result.

Jump to

Keyboard shortcuts

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