checks

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckRequestFunc

type CheckRequestFunc func(*http.Request, *testing.T)

CheckRequestFunc functions perform a check against an http.Request.

func CheckRequestBodyValue

func CheckRequestBodyValue(key string, value ...string) CheckRequestFunc

CheckRequestBodyValue checks that a requests URL-encoded body has the given key and value.

func CheckRequestHeaderKeyValue

func CheckRequestHeaderKeyValue(key string, value ...string) CheckRequestFunc

CheckRequestHeaderKeyValue checks that an http.Request's header has a given value for a given key.

func CheckRequestMethod

func CheckRequestMethod(method string) CheckRequestFunc

CheckRequestMethod checks that a requests method matches the given method.

func CheckRequestURL

func CheckRequestURL(url string) CheckRequestFunc

CheckRequestURL checks that a request's URL matches the given URL.

func ComposeCheckRequestFunc

func ComposeCheckRequestFunc(checks ...CheckRequestFunc) CheckRequestFunc

ComposeCheckRequestFunc returns a new CheckRequestFunc from an arbitrary number of other CheckRequestFunc functions.

type JSONUnmarshalTestCase

type JSONUnmarshalTestCase struct {
	Name        string
	InputString string
	Want        interface{}
	WantError   bool
}

JSONUnmarshalTestCase defines a test case for json.Unmarshal.

func (JSONUnmarshalTestCase) Test

func (test JSONUnmarshalTestCase) Test(t *testing.T)

Test runs the Test case.

type JSONUnmarshalTestCases

type JSONUnmarshalTestCases []JSONUnmarshalTestCase

JSONUnmarshalTestCases is a collection of JSONUnmarshalTestCases tests.

func (JSONUnmarshalTestCases) Test

func (tests JSONUnmarshalTestCases) Test(t *testing.T)

Test runs the Test defined for each item in the collection.

type QueryValuesTestCase

type QueryValuesTestCase struct {
	Name      string
	Input     interface{}
	Want      url.Values
	WantError bool
}

QueryValuesTestCase defines a test case for query.Values.

func (QueryValuesTestCase) Test

func (test QueryValuesTestCase) Test(t *testing.T)

Test runs the Test.

type QueryValuesTestCases

type QueryValuesTestCases []QueryValuesTestCase

QueryValuesTestCases is a collection of queryValuesTestCase tests.

func (QueryValuesTestCases) Test

func (tests QueryValuesTestCases) Test(t *testing.T)

Test runs the Test defined for each item in the collection.

Jump to

Keyboard shortcuts

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