MCPcopy Create free account
hub / github.com/kataras/iris / TestControllerBeginAndEndRequestFunc

Function TestControllerBeginAndEndRequestFunc

mvc/controller_test.go:122–144  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

120}
121
122func TestControllerBeginAndEndRequestFunc(t *testing.T) {
123 app := iris.New()
124 New(app.Party("/profile/{username}")).
125 Handle(new(testControllerBeginAndEndRequestFunc))
126
127 e := httptest.New(t, app)
128 usernames := []string{
129 "kataras",
130 "makis",
131 "efi",
132 "rg",
133 "bill",
134 "whoisyourdaddy",
135 }
136 doneResponse := "done"
137
138 for _, username := range usernames {
139 e.GET("/profile/" + username).Expect().Status(iris.StatusOK).
140 Body().IsEqual(username + doneResponse)
141 e.POST("/profile/" + username).Expect().Status(iris.StatusOK).
142 Body().IsEqual(username + doneResponse)
143 }
144}
145
146func TestControllerBeginAndEndRequestFuncBindMiddleware(t *testing.T) {
147 app := iris.New()

Callers

nothing calls this directly

Calls 7

NewFunction · 0.92
NewMethod · 0.80
StatusMethod · 0.80
NewFunction · 0.70
HandleMethod · 0.65
PartyMethod · 0.65
BodyMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…