public async Task EndJsonPaddingIfRequiredAsync_DoesNothingIfEmptyFunctionName() { settings.JsonPCallback = ""; await ODataJsonWriterUtils.EndJsonPaddingIfRequiredAsync(this.jsonWriter, settings); Assert.Empty(stringWriter.GetStringBuilder().ToString()); }
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)); }