(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestRequestSetJSONBody(t *testing.T) { |
| 12 | var r Request |
| 13 | raw := map[string]interface{}{"foo": "bar"} |
| 14 | if err := r.SetJSONBody(raw); err != nil { |
| 15 | t.Fatalf("err: %s", err) |
| 16 | } |
| 17 | |
| 18 | expected := `{"foo":"bar"}` |
| 19 | actual := strings.TrimSpace(string(r.BodyBytes)) |
| 20 | if actual != expected { |
| 21 | t.Fatalf("bad: %s", actual) |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | func TestRequestResetJSONBody(t *testing.T) { |
| 26 | var r Request |
nothing calls this directly
no test coverage detected
searching dependent graphs…