test

package
v0.0.0-...-b9b4979 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepEqual

func DeepEqual(t *testing.T, want, got interface{})

DeepEqual asserts that want DeepEquals to got.

func Endpoint

func Endpoint(t *testing.T, testCases []ApiTestCase, mux *httprouter.Router)

Endpoint tests the API endpoint using given test cases.

func IsNil

func IsNil(t *testing.T, err error)

IsNil asserts that err is nil.

func NotNil

func NotNil(t *testing.T, err error)

NotNil asserts that err is not nil.

Types

type ApiTestCase

type ApiTestCase struct {
	Name       string
	Method     string
	Url        string
	Body       string
	Header     http.Header
	WantCode   int
	WantBody   string
	WantHeader http.Header
}

ApiTestCases represents the data needed to describe an API endpoint test cases

Jump to

Keyboard shortcuts

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