Skip to content

findcoo/goTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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 {}

About

gin-gonic based web api test library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages