Categorygithub.com/findcoo/gotest
modulepackage
0.0.0-20170621085936-105714ee18a7
Repository: https://github.com/findcoo/gotest.git
Documentation: pkg.go.dev

# README

goTest

personal test tool for gin based http server

Go Report Card

Usage

var (
	caseOne = conf.NewCaseOne("develop")
	App     = setApp()
)

func setApp() *gin.Engine {
	r := testSuit.GetGinEngine()
	api.NewApp(caseOne)
	api.SetRouter(r)
	return r
}

func TestPing(*testing.T) {
	suit := &testSuit.TestSuit{
		Router: App,
		Method: "GET",
		URL:    "/ping",
	}

	resp := suit.Do()
	assert.Equal(t, 200, resp.Code)
}

Other function

// generate the random color image
func GenImage(ext string, width, height int) (*bytes.Buffer, string, error) {}

// return gin engine with test mode
func GetGinEngine() *gin.Engine {}

# Functions

GenImage generate randomize image.
GetGinEngine create gin.Engine with test mode.

# Structs

TestSuit http request test form.