httpunit

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: MIT Imports: 14 Imported by: 0

README

Build Status Code Coverage Go Report Card GoDoc

httpunit

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPFixture

type HTTPFixture struct {
	*gunit.Fixture

	RequestMethod  string
	RequestURL     url.URL
	RequestBody    string
	RequestHeaders http.Header
	RequestContext context.Context

	Response     *http.Response
	ResponseBody string

	Dump *bytes.Buffer
}

func NewHTTPFixture

func NewHTTPFixture(inner *gunit.Fixture) *HTTPFixture

func (*HTTPFixture) AssertInternalServerError

func (this *HTTPFixture) AssertInternalServerError()

func (*HTTPFixture) AssertJSONResponse

func (this *HTTPFixture) AssertJSONResponse(expectedStatus int, expectedBody interface{})

func (*HTTPFixture) DeserializeJSONResponseBody

func (this *HTTPFixture) DeserializeJSONResponseBody() (actual interface{})

func (*HTTPFixture) SerializeJSONRequestBody

func (this *HTTPFixture) SerializeJSONRequestBody(body interface{})

func (*HTTPFixture) Serve

func (this *HTTPFixture) Serve(handler http.Handler)

func (*HTTPFixture) SetQueryStringParameter

func (this *HTTPFixture) SetQueryStringParameter(key, value string)

func (*HTTPFixture) SetRequestContextValue

func (this *HTTPFixture) SetRequestContextValue(key, value interface{})

func (*HTTPFixture) Teardown

func (this *HTTPFixture) Teardown()

Jump to

Keyboard shortcuts

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