_test

package
v0.0.0-...-cb04537 Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertResponseError

func AssertResponseError(t *testing.T, response *httptest.ResponseRecorder, error resperr.ResponseError)

func DeleteRequest

func DeleteRequest(handler http.Handler, url string) *httptest.ResponseRecorder

func GetRequest

func GetRequest(handler http.Handler, url string) *httptest.ResponseRecorder

func PatchRequest

func PatchRequest(handler http.Handler, url string, i interface{}) *httptest.ResponseRecorder

func PostRequest

func PostRequest(handler http.Handler, url string, i interface{}) *httptest.ResponseRecorder

func PutRequest

func PutRequest(handler http.Handler, url string, i interface{}) *httptest.ResponseRecorder

Types

type SpyStore

type SpyStore struct {
	DeleteWasCall  bool
	GetWasCall     bool
	GetAllWasCall  bool
	AddWasCall     bool
	UpdateWasCall  bool
	OpenWasCall    bool
	CloseWasCall   bool
	IsReadyWasCall bool
	Id             int
	PetParameters  data.Pet
	// contains filtered or unexported fields
}

func NewSpyStore

func NewSpyStore() SpyStore

func (*SpyStore) AddPet

func (s *SpyStore) AddPet(name string, race string, mod string) (int, error)

func (*SpyStore) Close

func (s *SpyStore) Close() error

func (*SpyStore) DeletePet

func (s *SpyStore) DeletePet(id int) error

func (*SpyStore) GetAllPets

func (s *SpyStore) GetAllPets() ([]data.Pet, error)

func (*SpyStore) GetPet

func (s *SpyStore) GetPet(id int) (data.Pet, error)

func (*SpyStore) IsReady

func (s *SpyStore) IsReady() error

func (*SpyStore) Open

func (s *SpyStore) Open() error

func (*SpyStore) Reset

func (s *SpyStore) Reset()

func (*SpyStore) UpdatePet

func (s *SpyStore) UpdatePet(id int, name string, race string, mod string) (bool, error)

func (*SpyStore) WhenAddPet

func (s *SpyStore) WhenAddPet(addFunc func(name string, race string, mod string) (int, error))

func (*SpyStore) WhenClose

func (s *SpyStore) WhenClose(closeFunc func() error)

func (*SpyStore) WhenDeletePet

func (s *SpyStore) WhenDeletePet(deleteFunc func(id int) error)

func (*SpyStore) WhenGetAllPets

func (s *SpyStore) WhenGetAllPets(getAllFunc func() ([]data.Pet, error))

func (*SpyStore) WhenGetPet

func (s *SpyStore) WhenGetPet(getFunc func(id int) (data.Pet, error))

func (*SpyStore) WhenIsReady

func (s *SpyStore) WhenIsReady(isReadyFunc func() error)

func (*SpyStore) WhenOpen

func (s *SpyStore) WhenOpen(openFunc func() error)

func (*SpyStore) WhenUpdatePet

func (s *SpyStore) WhenUpdatePet(updateFunc func(id int, name string, race string, mod string) (bool, error))

Jump to

Keyboard shortcuts

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