webtest

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(t *testing.T, tc TestCaseChecker, resp *http.Response)

func Run

func Run(t *testing.T, uri string, tc TestCaseRun)

Types

type Case

type Case struct {
	// contains filtered or unexported fields
}

func Get200

func Get200() *Case

func (*Case) Body

func (tc *Case) Body(b string) TestCase

func (*Case) Code

func (tc *Case) Code(v int) TestCase

func (*Case) Contains

func (tc *Case) Contains(c string) TestCase

func (*Case) Delete added in v1.3.1

func (tc *Case) Delete() TestCase

func (*Case) Get

func (tc *Case) Get() TestCase

func (*Case) GetBody

func (tc *Case) GetBody() string

func (*Case) GetCode

func (tc *Case) GetCode() int

func (*Case) GetContains

func (tc *Case) GetContains() string

func (*Case) GetHeaders added in v1.3.1

func (tc *Case) GetHeaders() [][2]string

func (*Case) GetPath

func (tc *Case) GetPath() string

func (*Case) GetPayload

func (tc *Case) GetPayload() []byte

func (*Case) GetVerb

func (tc *Case) GetVerb() string

func (*Case) GetWhat added in v1.3.1

func (tc *Case) GetWhat() string

func (*Case) HeaderAdd added in v1.3.1

func (tc *Case) HeaderAdd(h [2]string) TestCase

func (*Case) Headers added in v1.3.1

func (tc *Case) Headers(h [][2]string) TestCase

func (*Case) Path

func (tc *Case) Path(p string) TestCase

func (*Case) PathAdd

func (tc *Case) PathAdd(p string) TestCase

func (*Case) Payload

func (tc *Case) Payload(b []byte) TestCase

func (*Case) PayloadStr added in v1.3.1

func (tc *Case) PayloadStr(b string) TestCase

func (*Case) Post

func (tc *Case) Post() TestCase

func (*Case) What added in v1.3.1

func (tc *Case) What(w string) TestCase

type TestCase

type TestCase interface {
	TestCaseChecker
	TestCaseRunner
	TestCaseSetter
}

type TestCaseChecker

type TestCaseChecker interface {
	GetCode() int
	GetBody() string
	GetContains() string
	GetHeaders() [][2]string
}

type TestCaseRun added in v1.3.1

type TestCaseRun interface {
	TestCaseChecker
	TestCaseRunner
}

type TestCaseRunner

type TestCaseRunner interface {
	GetPath() string
	GetPayload() []byte
	GetWhat() string
	GetVerb() string
}

type TestCaseSetter

type TestCaseSetter interface {
	Body(string) TestCase
	Code(int) TestCase
	Contains(string) TestCase
	Delete() TestCase
	Get() TestCase
	Headers([][2]string) TestCase
	HeaderAdd([2]string) TestCase
	Path(string) TestCase
	PathAdd(string) TestCase
	Payload([]byte) TestCase
	PayloadStr(string) TestCase
	Post() TestCase
	What(w string) TestCase
}

Jump to

Keyboard shortcuts

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