public void StartAndEndJsonPaddingSuccessTest() { settings.JsonPCallback = "functionName"; ODataJsonWriterUtils.StartJsonPaddingIfRequired(this.jsonWriter, settings); ODataJsonWriterUtils.EndJsonPaddingIfRequired(this.jsonWriter, settings); stringWriter.GetStringBuilder().ToString().Should().Be("functionName()"); }
/// <summary> /// Writes the end of the enitire JSON payload. /// </summary> /// <param name="disableResponseWrapper">When set to true the "d" response wrapper won't be written even in responses</param> internal void WritePayloadEnd(bool disableResponseWrapper) { DebugUtils.CheckNoExternalCallers(); if (this.WritingResponse && !disableResponseWrapper) { // If we were writing a response payload the entire JSON is wrapped in an object scope, which we need to close here. this.JsonWriter.EndObjectScope(); } ODataJsonWriterUtils.EndJsonPaddingIfRequired(this.JsonWriter, this.MessageWriterSettings); }
internal void WritePayloadEnd() { ODataJsonWriterUtils.EndJsonPaddingIfRequired(this.JsonWriter, this.MessageWriterSettings); }
public void EndJsonPaddingIfRequiredWillDoNothingIfEmptyFunctionName() { settings.JsonPCallback = ""; ODataJsonWriterUtils.EndJsonPaddingIfRequired(this.jsonWriter, settings); stringWriter.GetStringBuilder().ToString().Should().BeEmpty(); }
public void EndJsonPaddingIfRequiredWillDoNothingIfNullFunctionName() { settings.JsonPCallback = null; ODataJsonWriterUtils.EndJsonPaddingIfRequired(this.jsonWriter, settings); Assert.Empty(stringWriter.GetStringBuilder().ToString()); }
internal void WritePayloadEnd() { DebugUtils.CheckNoExternalCallers(); ODataJsonWriterUtils.EndJsonPaddingIfRequired(this.JsonWriter, this.MessageWriterSettings); }