public void CheckDefaultFormatters()
        {
            //Arrange
                var input = new foo { Bar = "hello" };
                var content = new ObjectContent<foo>(input);

                //Act
                var formatters = content.Formatters;

                //Assert
                Assert.AreEqual(4, formatters.Count);
        }
        public void SpecifyMediaType()
        {
            //Arrange
                var input = new foo { Bar = "hello" };
                var content = new ObjectContent<foo>(input, "text/plain");

                //Act
                var mediaType = content.Headers.ContentType.MediaType;

                //Assert
                Assert.AreEqual("text/plain", mediaType);
        }
        public void SpecifyMediaTypeAndSerializeAsJson()
        {
            //Arrange
                var input = new foo { Bar = "hello" };
                var content = new ObjectContent<foo>(input, "application/json");

                //Act
                var result = content.ReadAsStringAsync().Result;
                var mediaType = content.Headers.ContentType.MediaType;

                //Assert
                Assert.AreEqual("application/json", mediaType);
        }
        public void RoundTripAnObject()
        {
            //Arrange
                var input = new foo { Bar = "hello" };
                var content = new ObjectContent<foo>(input);

                //Act
                var output = content.ReadAsAsync<foo>().Result;

                //Assert
                Assert.AreEqual(input, output);
        }