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

Function TestStructFieldsSorter

hero/struct_test.go:108–121  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

106}
107
108func TestStructFieldsSorter(t *testing.T) { // see https://github.com/kataras/iris/issues/1343
109 b := New()
110 b.Register(&testServiceImpl1{"parser"})
111 b.Register(&testServiceImpl2{24})
112 s := b.Struct(&testControllerDependenciesSorter{}, 0)
113
114 app := iris.New()
115 app.Get("/", s.MethodHandler("Index", 0))
116
117 e := httptest.New(t, app)
118
119 expectedBody := `&hero_test.testServiceImpl1{inner:"parser"} | &hero_test.testServiceImpl2{tf:24}`
120 e.GET("/").Expect().Status(httptest.StatusOK).Body().IsEqual(expectedBody)
121}

Callers

nothing calls this directly

Calls 9

NewFunction · 0.92
NewMethod · 0.80
MethodHandlerMethod · 0.80
StatusMethod · 0.80
NewFunction · 0.70
RegisterMethod · 0.65
StructMethod · 0.65
GetMethod · 0.65
BodyMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…