testing

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2019 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Success  bool        `json:"success"`
	Error    *string     `json:"error,omitempty"`
	Token    *string     `json:"token,omitempty"`
	User     interface{} `json:"user,omitempty"`
	UserList interface{} `json:"userList,omitempty"`
}

payload response returned from api. this should be passed in as an argument eventually

type TestPayload

type TestPayload struct {
	Code     int
	Err      error
	Response *Response
}

test payload containing information about the request. should include response time

type TestingEnv

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

includes everything relevant to making requests to the api directly through the router

func (*TestingEnv) Expect

func (te *TestingEnv) Expect() string

func (*TestingEnv) ExpectedPayload

func (te *TestingEnv) ExpectedPayload(code int, err error, token string, user interface{}, userList interface{})

func (*TestingEnv) Init

func (te *TestingEnv) Init(s *sql.DB, r *mux.Router)

should initalize the database on its own eventually by being passed in a string

func (*TestingEnv) Prepare

func (te *TestingEnv) Prepare(method string, url string)

func (*TestingEnv) Request

func (te *TestingEnv) Request(jsonRequest []byte) TestPayload

Jump to

Keyboard shortcuts

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