VerifyException : Directory: D:\a\NSwag\NSwag\src\NSwag.CodeGeneration.CSharp.Tests\Snapshots
NotEqual:
- Received: ArrayParameterTests.when_content_is_formdata_with_property_array_then_content_should_be_added_in_foreach_in_csharp.received.txt
Verified: ArrayParameterTests.when_content_is_formdata_with_property_array_then_content_should_be_added_in_foreach_in_csharp.verified.txt
FileContent:
NotEqual:
Received: ArrayParameterTests.when_content_is_formdata_with_property_array_then_content_should_be_added_in_foreach_in_csharp.received.txt
namespace MyNamespace
{
using System = global::System;
public partial class MyClass
{
#pragma warning disable 8618
private string _baseUrl;
#pragma warning restore 8618
private System.Net.Http.HttpClient _httpClient;
private static System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings, true);
private Newtonsoft.Json.JsonSerializerSettings _instanceSettings;
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public MyClass(string baseUrl, System.Net.Http.HttpClient httpClient)
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
{
BaseUrl = baseUrl;
_httpClient = httpClient;
Initialize();
}
private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings()
{
var settings = new Newtonsoft.Json.JsonSerializerSettings();
UpdateJsonSerializerSettings(settings);
return settings;
}
public string BaseUrl
{
get { return _baseUrl; }
set
{
_baseUrl = value;
if (!string.IsNullOrEmpty(_baseUrl) && !_baseUrl.EndsWith("/"))
_baseUrl += '/';
}
}
protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } }
static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
partial void Initialize();
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);
public virtual System.Threading.Tasks.Task<FileResponse> UploadFileAsync(FileParameter file, System.Collections.Generic.IEnumerable<string> arrayOfIds, string test)
{
return UploadFileAsync(file, arrayOfIds, test, System.Threading.CancellationToken.None);
}
public virtual async System.Threading.Tasks.Task<FileResponse> UploadFileAsync(FileParameter file, System.Collections.Generic.IEnumerable<string> arrayOfIds, string test, System.Threading.CancellationToken cancellationToken)
{
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
var boundary_ = System.Guid.NewGuid().ToString();
var content_ = new System.Net.Http.MultipartFormDataContent(boundary_);
content_.Headers.Remove("Content-Type");
content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_);
if (file != null)
{
var content_file_ = new System.Net.Http.StreamContent(file.Data);
if (!string.IsNullOrEmpty(file.ContentType))