helpers

package
v0.0.0-...-db3ee06 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const UserId = 1

Variables

This section is empty.

Functions

func Init

func Init() *gorm.DB

func NewServer

func NewServer() *server.Server

func PrepareContextFromTestCase

func PrepareContextFromTestCase(s *server.Server, test TestCase) (c echo.Context, recorder *httptest.ResponseRecorder)

Types

type ExpectedResponse

type ExpectedResponse struct {
	StatusCode int
	BodyPart   string
}

type MockReply

type MockReply []map[string]interface{}

type PathParam

type PathParam struct {
	Name  string
	Value string
}

type QueryMock

type QueryMock struct {
	Query string
	Reply MockReply
}

type Request

type Request struct {
	Method    string
	Url       string
	PathParam *PathParam
}

type TestCase

type TestCase struct {
	TestName    string
	Request     Request
	RequestBody interface{}
	HandlerFunc func(s *server.Server, c echo.Context) error
	QueryMock   *QueryMock
	Expected    ExpectedResponse
}

Jump to

Keyboard shortcuts

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