Home / Function/ TestRouterMethod() — gin Function Reference

TestRouterMethod() — gin Function Reference

Architecture documentation for the TestRouterMethod() function in routes_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  50c7d563_9178_9f5f_c8b6_0478866b5cec["TestRouterMethod()"]
  69c2add5_555a_3d82_a4e7_993886631a2c["PerformRequest()"]
  50c7d563_9178_9f5f_c8b6_0478866b5cec -->|calls| 69c2add5_555a_3d82_a4e7_993886631a2c
  style 50c7d563_9178_9f5f_c8b6_0478866b5cec fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

routes_test.go lines 89–107

func TestRouterMethod(t *testing.T) {
	router := New()
	router.PUT("/hey2", func(c *Context) {
		c.String(http.StatusOK, "sup2")
	})

	router.PUT("/hey", func(c *Context) {
		c.String(http.StatusOK, "called")
	})

	router.PUT("/hey3", func(c *Context) {
		c.String(http.StatusOK, "sup3")
	})

	w := PerformRequest(router, http.MethodPut, "/hey")

	assert.Equal(t, http.StatusOK, w.Code)
	assert.Equal(t, "called", w.Body.String())
}

Domain

Subdomains

Frequently Asked Questions

What does TestRouterMethod() do?
TestRouterMethod() is a function in the gin codebase.
What does TestRouterMethod() call?
TestRouterMethod() calls 1 function(s): PerformRequest.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free