test

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRequestBody

func AddRequestBody(c *gin.Context, data string)

AddRequestBody create a request body from a json string

func DefaultAPIKey

func DefaultAPIKey() string

DefaultAPIKey returns the default testing api key

func DefaultSecret

func DefaultSecret() string

DefaultSecret returns the default testing secret

func SetRequestContentType

func SetRequestContentType(c *gin.Context, contentType string)

SetRequestContentType set the request content type

func SetRequestHeader

func SetRequestHeader(c *gin.Context, key, value string)

SetRequestHeader set the request header

func SetRequestMethod

func SetRequestMethod(c *gin.Context, method string)

SetRequestMethod set the request method

func SetRequestParams

func SetRequestParams(c *gin.Context, value string)

SetRequestParams set the request url

func StringToJSONArray

func StringToJSONArray(value string) []string

StringToJSONArray convert a json string to a string array

Types

type Test

type Test struct {
	Name      string
	Mock      func()
	Validator func(t *testing.T, value interface{}, err error)
}

Test is a test

Jump to

Keyboard shortcuts

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