示例#1
0
 public void StartAndEndJsonPaddingSuccessTest()
 {
     settings.JsonPCallback = "functionName";
     ODataJsonWriterUtils.StartJsonPaddingIfRequired(this.jsonWriter, settings);
     ODataJsonWriterUtils.EndJsonPaddingIfRequired(this.jsonWriter, settings);
     stringWriter.GetStringBuilder().ToString().Should().Be("functionName()");
 }
示例#2
0
        /// <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);
 }
示例#4
0
 public void EndJsonPaddingIfRequiredWillDoNothingIfEmptyFunctionName()
 {
     settings.JsonPCallback = "";
     ODataJsonWriterUtils.EndJsonPaddingIfRequired(this.jsonWriter, settings);
     stringWriter.GetStringBuilder().ToString().Should().BeEmpty();
 }
示例#5
0
 public void EndJsonPaddingIfRequiredWillDoNothingIfNullFunctionName()
 {
     settings.JsonPCallback = null;
     ODataJsonWriterUtils.EndJsonPaddingIfRequired(this.jsonWriter, settings);
     Assert.Empty(stringWriter.GetStringBuilder().ToString());
 }
示例#6
0
 internal void WritePayloadEnd()
 {
     DebugUtils.CheckNoExternalCallers();
     ODataJsonWriterUtils.EndJsonPaddingIfRequired(this.JsonWriter, this.MessageWriterSettings);
 }