(t *testing.T)
| 688 | } |
| 689 | |
| 690 | func TestControllerMethodHandlerBindStruct(t *testing.T) { |
| 691 | app := iris.New() |
| 692 | |
| 693 | m := New(app.Party("/data")) |
| 694 | m.HandleError(func(ctx iris.Context, err error) { |
| 695 | t.Fatalf("Path: %s, Error: %v", ctx.Path(), err) |
| 696 | }) |
| 697 | |
| 698 | m.Handle(new(testControllerMethodHandlerBindStruct)) |
| 699 | |
| 700 | data := bindStructData{Name: "kataras"} |
| 701 | manyData := []bindStructData{data, {"john doe"}} |
| 702 | |
| 703 | e := httptest.New(t, app) |
| 704 | e.GET("/data").WithQueryObject(data).Expect().Status(httptest.StatusOK).JSON().IsEqual(data) |
| 705 | e.PATCH("/data").WithJSON(data).Expect().Status(httptest.StatusOK).JSON().IsEqual(data) |
| 706 | e.POST("/data/42/slice").WithJSON(manyData).Expect().Status(httptest.StatusOK).JSON().IsEqual(manyData) |
| 707 | e.POST("/data/42/slicetype").WithJSON(manyData).Expect().Status(httptest.StatusOK).JSON().IsEqual(manyData) |
| 708 | e.POST("/data/42/slicetypeptr").WithJSON(manyData).Expect().Status(httptest.StatusOK).JSON().IsEqual(manyData) |
| 709 | // more tests inside the hero package itself. |
| 710 | } |
| 711 | |
| 712 | func TestErrorHandlerContinue(t *testing.T) { |
| 713 | app := iris.New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…