test

package
v2.3.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Eq          = assert.Equal
	NotEq       = assert.NotEqual
	True        = assert.True
	False       = assert.False
	NotNil      = assert.NotNil
	Empty       = assert.Empty
	NotEmpty    = assert.NotEmpty
	Len         = assert.Len
	Contains    = assert.Contains
	NotContains = assert.NotContains
	Subset      = assert.Subset
	NotSubset   = assert.NotSubset
)

Functions

func DefaultChecker

func DefaultChecker(value string) func(t *testing.T, r *httptest.ResponseRecorder, buf *bytes.Buffer)

func Hit

func Hit(t *testing.T, configs []*Config, middelwares ...MiddlewareTest)

func HitBy

func HitBy(custom func(e *echo.Echo) echo.Context, t *testing.T, configs []*Config, middelwares ...MiddlewareTest)

Types

type Config

type Config struct {
	Method, Path string
	Handler      HandlerTest
	ReqRewrite   []func(*http.Request)
	Checker      func(*testing.T, *httptest.ResponseRecorder, *bytes.Buffer)
	Middlewares  []MiddlewareTest
}

type HandlerTest

type HandlerTest func(*bytes.Buffer) echo.HandlerFunc

type MiddlewareTest

type MiddlewareTest func(*bytes.Buffer) echo.MiddlewareFuncd

Jump to

Keyboard shortcuts

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