testutils

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

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

func NewMock

func NewMock() *Mock

func (*Mock) Anything

func (m *Mock) Anything() anything

func (*Mock) FromStage

func (m *Mock) FromStage(fn interface{}, resultPtr ...interface{})

func (*Mock) LastCalledWith

func (m *Mock) LastCalledWith(fn interface{}, args ...interface{}) error

func (*Mock) OfType

func (m *Mock) OfType() ofType

func (*Mock) Reset

func (m *Mock) Reset()

func (*Mock) ResetCalls

func (m *Mock) ResetCalls()

func (*Mock) Stage

func (m *Mock) Stage(fn interface{}, result ...interface{})

func (*Mock) TimeRange

func (m *Mock) TimeRange(duration time.Duration) mockTime

func (*Mock) Trace

func (m *Mock) Trace(fn interface{}, args ...interface{})

func (*Mock) WasCalledNTimes

func (m *Mock) WasCalledNTimes(fn interface{}, n int) error

func (*Mock) WasCalledWith

func (m *Mock) WasCalledWith(fn interface{}, args ...interface{}) error

type MockServer

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

func NewMockServer

func NewMockServer(addr string) (s *MockServer, err error)

func (*MockServer) Addr

func (s *MockServer) Addr() string

func (*MockServer) LastRequest

func (s *MockServer) LastRequest() *http.Request

func (*MockServer) MockCallback

func (s *MockServer) MockCallback(path string, res http.HandlerFunc)

func (*MockServer) MockResponse

func (s *MockServer) MockResponse(method, path string, status int, body io.Reader, headers map[string]string)

func (*MockServer) ResetCalls

func (s *MockServer) ResetCalls()

func (*MockServer) ServeHTTP

func (s *MockServer) ServeHTTP(writer http.ResponseWriter, request *http.Request)

func (*MockServer) Stop

func (s *MockServer) Stop()

Jump to

Keyboard shortcuts

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