(t *testing.T)
| 737 | } |
| 738 | |
| 739 | func TestEventInternalServerError(t *testing.T) { |
| 740 | err := new(router.Event).InternalServerError("message_test", map[string]any{"a": validation.Required, "b": "test"}) |
| 741 | |
| 742 | result, _ := json.Marshal(err) |
| 743 | expected := `{"data":{"a":{"code":"validation_invalid_value","message":"Invalid value."},"b":{"code":"validation_invalid_value","message":"Invalid value."}},"message":"Message_test.","status":500}` |
| 744 | |
| 745 | if string(result) != expected { |
| 746 | t.Errorf("Expected\n%s\ngot\n%s", expected, result) |
| 747 | } |
| 748 | } |
| 749 | |
| 750 | func TestEventBindBody(t *testing.T) { |
| 751 | type testDstStruct struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…