public void Response_Deserialize_Serialize() { var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("WebApiContribTests.Data.Response.cs"); var serializer = new MessageContentHttpMessageSerializer(); var response = serializer.DeserializeToResponseAsync(stream).Result; var memoryStream = new MemoryStream(); serializer.SerializeAsync(TaskHelpers.FromResult(response), memoryStream).Wait(); memoryStream.Position = 0; var response2 = serializer.DeserializeToResponseAsync(memoryStream).Result; var result = DeepComparer.Compare(response, response2); if(result.Count()>0) Assert.Fail(string.Join("\r\n", result)); }