(t *testing.T)
| 1615 | } |
| 1616 | |
| 1617 | func TestContextNegotiationWithXML(t *testing.T) { |
| 1618 | w := httptest.NewRecorder() |
| 1619 | c, _ := CreateTestContext(w) |
| 1620 | c.Request, _ = http.NewRequest(http.MethodPost, "", nil) |
| 1621 | |
| 1622 | c.Negotiate(http.StatusOK, Negotiate{ |
| 1623 | Offered: []string{MIMEXML, MIMEJSON, MIMEYAML, MIMEYAML2}, |
| 1624 | Data: H{"foo": "bar"}, |
| 1625 | }) |
| 1626 | |
| 1627 | assert.Equal(t, http.StatusOK, w.Code) |
| 1628 | assert.Equal(t, "<map><foo>bar</foo></map>", w.Body.String()) |
| 1629 | assert.Equal(t, "application/xml; charset=utf-8", w.Header().Get("Content-Type")) |
| 1630 | } |
| 1631 | |
| 1632 | func TestContextNegotiationWithYAML(t *testing.T) { |
| 1633 | w := httptest.NewRecorder() |
nothing calls this directly
no test coverage detected