public void WriteObject_ThrowsArgumentNull_WriteContext()
 {
     ODataFeedSerializer serializer = new ODataFeedSerializer(new DefaultODataSerializerProvider());
     Assert.ThrowsArgumentNull(
         () => serializer.WriteObject(graph: null, type: null, messageWriter: ODataTestUtil.GetMockODataMessageWriter(), writeContext: null),
         "writeContext");
 }
 public void WriteObject_ThrowsArgumentNull_MessageWriter()
 {
     ODataFeedSerializer serializer = new ODataFeedSerializer(new DefaultODataSerializerProvider());
     Assert.ThrowsArgumentNull(
         () => serializer.WriteObject(graph: null, type: null, messageWriter: null, writeContext: new ODataSerializerContext()),
         "messageWriter");
 }
        public void WriteObject_ThrowsEntitySetMissingDuringSerialization()
        {
            ODataFeedSerializer serializer = new ODataFeedSerializer(new DefaultODataSerializerProvider());

            Assert.Throws <SerializationException>(
                () => serializer.WriteObject(graph: null, type: null, messageWriter: ODataTestUtil.GetMockODataMessageWriter(), writeContext: new ODataSerializerContext()),
                "The related entity set could not be found from the OData path. The related entity set is required to serialize the payload.");
        }
        public void WriteObject_ThrowsArgumentNull_WriteContext()
        {
            ODataFeedSerializer serializer = new ODataFeedSerializer(new DefaultODataSerializerProvider());

            Assert.ThrowsArgumentNull(
                () => serializer.WriteObject(graph: null, type: null, messageWriter: ODataTestUtil.GetMockODataMessageWriter(), writeContext: null),
                "writeContext");
        }
        public void WriteObject_ThrowsArgumentNull_MessageWriter()
        {
            ODataFeedSerializer serializer = new ODataFeedSerializer(new DefaultODataSerializerProvider());

            Assert.ThrowsArgumentNull(
                () => serializer.WriteObject(graph: null, type: null, messageWriter: null, writeContext: new ODataSerializerContext()),
                "messageWriter");
        }
 public void WriteObject_ThrowsEntitySetMissingDuringSerialization()
 {
     ODataFeedSerializer serializer = new ODataFeedSerializer(new DefaultODataSerializerProvider());
     Assert.Throws<SerializationException>(
         () => serializer.WriteObject(graph: null, type: null, messageWriter: ODataTestUtil.GetMockODataMessageWriter(), writeContext: new ODataSerializerContext()),
         "The related entity set could not be found from the OData path. The related entity set is required to serialize the payload.");
 }