MCPcopy
hub / github.com/gofiber/fiber / Test_App_RegisterNetHTTPHandler

Function Test_App_RegisterNetHTTPHandler

app_test.go:252–373  ·  app_test.go::Test_App_RegisterNetHTTPHandler
(t *testing.T)

Source from the content-addressed store, hash-verified

250}
251
252func Test_App_RegisterNetHTTPHandler(t *testing.T) {
253 t.Parallel()
254
255 tests := []struct {
256 name string
257 register func(app *App, path string, handler any)
258 method string
259 expectBody bool
260 }{
261 {
262 name: "Get",
263 register: func(app *App, path string, handler any) {
264 app.Get(path, handler)
265 },
266 method: http.MethodGet,
267 expectBody: true,
268 },
269 {
270 name: "Head",
271 register: func(app *App, path string, handler any) {
272 app.Head(path, handler)
273 },
274 method: http.MethodHead,
275 },
276 {
277 name: "Post",
278 register: func(app *App, path string, handler any) {
279 app.Post(path, handler)
280 },
281 method: http.MethodPost,
282 expectBody: true,
283 },
284 {
285 name: "Put",
286 register: func(app *App, path string, handler any) {
287 app.Put(path, handler)
288 },
289 method: http.MethodPut,
290 expectBody: true,
291 },
292 {
293 name: "Delete",
294 register: func(app *App, path string, handler any) {
295 app.Delete(path, handler)
296 },
297 method: http.MethodDelete,
298 expectBody: true,
299 },
300 {
301 name: "Connect",
302 register: func(app *App, path string, handler any) {
303 app.Connect(path, handler)
304 },
305 method: http.MethodConnect,
306 expectBody: true,
307 },
308 {
309 name: "Options",

Callers

nothing calls this directly

Calls 15

registerMethod · 0.80
TestMethod · 0.80
NewFunction · 0.70
GetMethod · 0.65
HeadMethod · 0.65
PostMethod · 0.65
PutMethod · 0.65
DeleteMethod · 0.65
ConnectMethod · 0.65
OptionsMethod · 0.65
TraceMethod · 0.65
PatchMethod · 0.65

Tested by

no test coverage detected