jsonapitest

package
v0.0.0-...-5001978 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Catch

func Catch(f func()) (res interface{})

func Check

func Check(err error)

Types

type CrStatusCode

type CrStatusCode struct {
	Code int
}

func SetStatusCode

func SetStatusCode(code int) *CrStatusCode

func (*CrStatusCode) Check

func (crstatus *CrStatusCode) Check(session *TestSession)

func (*CrStatusCode) Describe

func (crstatus *CrStatusCode) Describe() string

func (*CrStatusCode) Setup

func (crstatus *CrStatusCode) Setup(session *TestSession)

type CrURL

type CrURL struct {
	Url string
}

func SetURL

func SetURL(url string) *CrURL

func (*CrURL) Check

func (url *CrURL) Check(session *TestSession)

func (*CrURL) Describe

func (url *CrURL) Describe() string

func (*CrURL) Setup

func (crurl *CrURL) Setup(session *TestSession)

type Criterion

type Criterion interface {
	Describe() string
	Setup(*TestSession)
	Check(*TestSession)
}

type Test

type Test struct {
	Criteria []Criterion
}

func NewTest

func NewTest(c ...Criterion) Test

func (*Test) Describe

func (test *Test) Describe() string

type TestSession

type TestSession struct {
	Test     *Test
	Server   *httptest.Server
	Request  *http.Request
	Response *http.Response
}

type TestSuite

type TestSuite struct {
	T     *testing.T
	Tests []Test
}

func NewTestSuite

func NewTestSuite(T *testing.T) *TestSuite

func (*TestSuite) PushNewTest

func (ts *TestSuite) PushNewTest(cr ...Criterion)

func (*TestSuite) PushTests

func (ts *TestSuite) PushTests(tests ...Test)

func (*TestSuite) Run

func (ts *TestSuite) Run(server *httptest.Server)

Jump to

Keyboard shortcuts

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