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

Function TestStructErrorHandler

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

Source from the content-addressed store, hash-verified

64}
65
66func TestStructErrorHandler(t *testing.T) {
67 b := New()
68 s := b.Struct(&testStructErrorHandler{}, 0)
69
70 app := iris.New()
71 app.Get("/{errText:string}", s.MethodHandler("Handle", 0))
72
73 expectedErrText := "an error"
74 e := httptest.New(t, app)
75 e.GET("/" + expectedErrText).Expect().Status(httptest.StatusConflict).Body().IsEqual(expectedErrText)
76}
77
78type (
79 testServiceInterface1 interface {

Callers

nothing calls this directly

Calls 8

NewFunction · 0.92
NewMethod · 0.80
MethodHandlerMethod · 0.80
StatusMethod · 0.80
NewFunction · 0.70
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…