// RouteTo to dispatch http request to the router object to emulate the request/response. func (r *TestRequest) RouteTo(router *wcg.Router) *TestResponse { router.Dispatch(r.res, r.Request) body, err := ioutil.ReadAll(r.recorder.Body) if err != nil { panic(err) } return &TestResponse{ r.recorder.Code, r.recorder.Header(), body, r, } }