public void HttpContentHelper_StringContentJson_Encodes_Object_As_Json() { var content = HttpContentHelper.StringContentJson(new { Value = 1 }); var text = content.ReadAsStringAsync().Result; Assert.AreEqual(@"{""Value"":1}", text); }
public void HttpContentHelper_StringContentJson_Throws_On_Null_Object() { HttpContentHelper.StringContentJson(null); }
public void HttpContentHelper_StringContentJson_Has_Correct_ContentType() { var content = HttpContentHelper.StringContentJson(new { Value = 1 }); Assert.AreEqual("application/json; charset=utf-8", content.Headers.ContentType.ToString()); }