示例#1
0
        public async Task EndJsonPaddingIfRequiredAsync_DoesNothingIfEmptyFunctionName()
        {
            settings.JsonPCallback = "";
            await ODataJsonWriterUtils.EndJsonPaddingIfRequiredAsync(this.jsonWriter, settings);

            Assert.Empty(stringWriter.GetStringBuilder().ToString());
        }
示例#2
0
        public async Task StartAndEndJsonPaddingAsync_SuccessTest()
        {
            settings.JsonPCallback = "functionName";
            await ODataJsonWriterUtils.StartJsonPaddingIfRequiredAsync(this.jsonWriter, settings);

            await ODataJsonWriterUtils.EndJsonPaddingIfRequiredAsync(this.jsonWriter, settings);

            Assert.Equal("functionName()", stringWriter.GetStringBuilder().ToString());
        }
 /// <summary>
 /// Asynchronously writes the end of the entire JSON payload.
 /// </summary>
 /// <returns>A task that represents the asynchronous write operation.</returns>
 internal Task WritePayloadEndAsync()
 {
     return(ODataJsonWriterUtils.EndJsonPaddingIfRequiredAsync(this.AsynchronousJsonWriter, this.MessageWriterSettings));
 }