testing

package
v0.26.18 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockServer

type MockServer struct {
	HandlerCalled bool
	Body          string
	ResponseCode  int
	Server        *httptest.Server
	URL           string
	CapturedPath  string
	CapturedBody  string
	Headers       map[string]string
}

func NewMockServer

func NewMockServer() *MockServer

func (*MockServer) ExpectCalled

func (m *MockServer) ExpectCalled(c *C, expectCalled bool, path string)

func (*MockServer) ExpectError

func (m *MockServer) ExpectError(c *C, err error, path, expectedErrorString string)

func (*MockServer) Start

func (m *MockServer) Start(c *C) *MockServer

func (*MockServer) Stop

func (m *MockServer) Stop()

func (*MockServer) WithBody

func (m *MockServer) WithBody(body string) *MockServer

func (*MockServer) WithHeader

func (m *MockServer) WithHeader(key, value string) *MockServer

func (*MockServer) WithResponseCode

func (m *MockServer) WithResponseCode(code int) *MockServer

Jump to

Keyboard shortcuts

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