Documentation ¶
Index ¶
- func Decode(t *testing.T, r io.Reader, into interface{})
- func Marshal(t *testing.T, payload interface{}) *bytes.Buffer
- func MarshalBytes(t *testing.T, payload interface{}) []byte
- type ServerBuilder
- func (s ServerBuilder) Build() *httptest.Server
- func (s ServerBuilder) Data(data interface{}) ServerBuilder
- func (s ServerBuilder) Method(method string) ServerBuilder
- func (s ServerBuilder) Path(path string) ServerBuilder
- func (s ServerBuilder) Query(query string) ServerBuilder
- func (s ServerBuilder) Return(responseCode int) ServerBuilder
- func (s ServerBuilder) Token(token string) ServerBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
Marshal unmarshalls the payload and returns a *bytes.Buffer with the content, or fails the test if unable to
func MarshalBytes ¶
MarshalBytes unmarshals the payload and returns a []byte with the content, or fails the test if unable to
Types ¶
type ServerBuilder ¶
type ServerBuilder struct {
// contains filtered or unexported fields
}
func NewTestServer ¶
func NewTestServer(t *testing.T) ServerBuilder
func (ServerBuilder) Build ¶
func (s ServerBuilder) Build() *httptest.Server
func (ServerBuilder) Data ¶
func (s ServerBuilder) Data(data interface{}) ServerBuilder
func (ServerBuilder) Method ¶
func (s ServerBuilder) Method(method string) ServerBuilder
func (ServerBuilder) Path ¶
func (s ServerBuilder) Path(path string) ServerBuilder
func (ServerBuilder) Query ¶
func (s ServerBuilder) Query(query string) ServerBuilder
func (ServerBuilder) Return ¶
func (s ServerBuilder) Return(responseCode int) ServerBuilder
func (ServerBuilder) Token ¶
func (s ServerBuilder) Token(token string) ServerBuilder
Click to show internal directories.
Click to hide internal directories.