test

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRecord

func CreateRecord(s interface{})

CreateRecord 用来在测试过程中往数据库插入一条记录

func GetAreas

func GetAreas() (areas []entity.Area)

func InitApiTest

func InitApiTest(m *testing.M)

func RunApiTest

func RunApiTest(t *testing.T, rFunc RegisterRouterFunc, cases []ApiTestCase, opts ...Option)

RunApiTest 根据配置运行API测试

Types

type ApiTestCase

type ApiTestCase struct {
	Method  string
	Path    string
	Body    string
	Status  int64
	Reason  string
	IsArray []string
	IsID    []string
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithAreas

func WithAreas(areaID uint64) Option

func WithRoles

func WithRoles(roles ...string) Option

type RegisterRouterFunc

type RegisterRouterFunc func(r gin.IRouter)

Jump to

Keyboard shortcuts

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