From 9404742758cf8a671101702a7d382e01929e6095 Mon Sep 17 00:00:00 2001 From: Luca Mazzanti Date: Mon, 3 May 2021 16:31:54 +0200 Subject: [PATCH 1/9] [csharp-netcore] correct rawContent read --- .../libraries/httpclient/ApiClient.mustache | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache index 619bcb6bfbb5..78a4bce4ade9 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache @@ -399,10 +399,10 @@ namespace {{packageName}}.Client partial void InterceptRequest(HttpRequestMessage req); partial void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response); - private ApiResponse ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) + private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) { T result = (T) responseData; - string rawContent = response.Content.ToString(); + string rawContent = await response.Content.ReadAsStringAsync(); var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) { @@ -523,9 +523,7 @@ namespace {{packageName}}.Client InterceptResponse(req, response); - var result = ToApiResponse(response, responseData, req.RequestUri); - - return result; + return await ToApiResponse(response, responseData, req.RequestUri); } {{#supportsAsync}} From cea4cf90cb5c487bcb83d6b6561312e4b6a4f601 Mon Sep 17 00:00:00 2001 From: Luca Mazzanti Date: Mon, 3 May 2021 16:32:45 +0200 Subject: [PATCH 2/9] [csharp-netcore] avoid deserialize result when in error --- .../csharp-netcore/libraries/httpclient/ApiClient.mustache | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache index 78a4bce4ade9..4f2a0cb50711 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache @@ -509,6 +509,11 @@ namespace {{packageName}}.Client } {{/supportsRetry}} + if (!response.IsSuccessStatusCode) + { + return await ToApiResponse(response, default(T), req.RequestUri); + } + object responseData = deserializer.Deserialize(response); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data From 1ad9a745b6d76e7b317690eef959dc0aff75d5f2 Mon Sep 17 00:00:00 2001 From: Luca Mazzanti Date: Mon, 3 May 2021 17:02:42 +0200 Subject: [PATCH 3/9] [csharp-netcore] avoid aggregate exceptions --- .../libraries/httpclient/ApiClient.mustache | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache index 4f2a0cb50711..1a87550c374d 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache @@ -98,13 +98,13 @@ namespace {{packageName}}.Client if (type == typeof(byte[])) // return byte array { - return response.Content.ReadAsByteArrayAsync().Result; + return response.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult(); } // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) if (type == typeof(Stream)) { - var bytes = response.Content.ReadAsByteArrayAsync().Result; + var bytes = response.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult(); if (headers != null) { var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath) @@ -128,18 +128,18 @@ namespace {{packageName}}.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content.ReadAsStringAsync().Result, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(), null, System.Globalization.DateTimeStyles.RoundtripKind); } if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type { - return Convert.ChangeType(response.Content.ReadAsStringAsync().Result, type); + return Convert.ChangeType(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(), type); } // at this point, it must be a model (json) try { - return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result, type, _serializerSettings); + return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(), type, _serializerSettings); } catch (Exception e) { @@ -444,7 +444,7 @@ namespace {{packageName}}.Client private ApiResponse Exec(HttpRequestMessage req, IReadableConfiguration configuration) { - return ExecAsync(req, configuration).Result; + return ExecAsync(req, configuration).GetAwaiter().GetResult(); } private async Task> ExecAsync(HttpRequestMessage req, From 0a4fcadff22a6c2d7c58d15243612f4f3a95bcee Mon Sep 17 00:00:00 2001 From: Luca Mazzanti Date: Mon, 3 May 2021 17:05:57 +0200 Subject: [PATCH 4/9] Updated samples --- .../src/Org.OpenAPITools/Client/ApiClient.cs | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs index 26695dd48d45..e5755d27df8f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -98,13 +98,13 @@ internal object Deserialize(HttpResponseMessage response, Type type) if (type == typeof(byte[])) // return byte array { - return response.Content.ReadAsByteArrayAsync().Result; + return response.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult(); } // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) if (type == typeof(Stream)) { - var bytes = response.Content.ReadAsByteArrayAsync().Result; + var bytes = response.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult(); if (headers != null) { var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath) @@ -128,18 +128,18 @@ internal object Deserialize(HttpResponseMessage response, Type type) if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content.ReadAsStringAsync().Result, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(), null, System.Globalization.DateTimeStyles.RoundtripKind); } if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type { - return Convert.ChangeType(response.Content.ReadAsStringAsync().Result, type); + return Convert.ChangeType(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(), type); } // at this point, it must be a model (json) try { - return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result, type, _serializerSettings); + return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(), type, _serializerSettings); } catch (Exception e) { @@ -397,10 +397,10 @@ private HttpRequestMessage NewRequest( partial void InterceptRequest(HttpRequestMessage req); partial void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response); - private ApiResponse ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) + private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) { T result = (T) responseData; - string rawContent = response.Content.ToString(); + string rawContent = await response.Content.ReadAsStringAsync(); var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) { @@ -442,7 +442,7 @@ private ApiResponse ToApiResponse(HttpResponseMessage response, object res private ApiResponse Exec(HttpRequestMessage req, IReadableConfiguration configuration) { - return ExecAsync(req, configuration).Result; + return ExecAsync(req, configuration).GetAwaiter().GetResult(); } private async Task> ExecAsync(HttpRequestMessage req, @@ -503,6 +503,11 @@ private async Task> ExecAsync(HttpRequestMessage req, response = await _httpClient.SendAsync(req, cancellationToken).ConfigureAwait(false); } + if (!response.IsSuccessStatusCode) + { + return await ToApiResponse(response, default(T), req.RequestUri); + } + object responseData = deserializer.Deserialize(response); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data @@ -517,9 +522,7 @@ private async Task> ExecAsync(HttpRequestMessage req, InterceptResponse(req, response); - var result = ToApiResponse(response, responseData, req.RequestUri); - - return result; + return await ToApiResponse(response, responseData, req.RequestUri); } #region IAsynchronousClient From baf77f982c89cac96f86dc6d35de8ae3932d64e7 Mon Sep 17 00:00:00 2001 From: Luca Mazzanti Date: Tue, 4 May 2021 17:14:06 +0200 Subject: [PATCH 5/9] Updated samples --- .../Org.OpenAPITools.Test/Api/PetApiTests.cs | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs index eca3164a17fd..ef48856396dc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -34,6 +34,7 @@ public class PetApiTests : IDisposable private PetApi instance; private long petId = 11088; + private long notExsistentPetId = 99999; /// /// Create a Pet object @@ -198,6 +199,26 @@ public void TestGetPetByIdAsync() Assert.Equal("sample category name2", response.Category.Name); } + /// + /// Test GetPetById on an not existent Id + /// + [Fact] + public void TestGetPetById_TestException() + { + PetApi petApi = new PetApi(); + var task = petApi.GetPetById(notExsistentPetId); + + var exception = Assert.Throws(() => + { + petApi.GetPetById(notExsistentPetId); + }); + + Assert.IsType(exception); + Assert.Equal(404, exception.ErrorCode); + Assert.Equal("{\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}", exception.ErrorContent); + Assert.Equal("Error calling GetPetById: {\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}", exception.Message); + } + /* a simple test for binary response. no longer in use. [Fact] public void TestGetByIdBinaryResponse() @@ -241,7 +262,25 @@ public void TestGetPetByIdWithHttpInfoAsync() Assert.Equal(56, response.Category.Id); Assert.Equal("sample category name2", response.Category.Name); } - + + [Fact] + public void TestGetPetByIdWithHttpInfoAsync_Test404Response() + { + PetApi petApi = new PetApi(); + petApi.ExceptionFactory = null; + var response = petApi.GetPetByIdWithHttpInfoAsync(notExsistentPetId).Result; + Pet result = response.Data; + + Assert.IsType>(response); + Assert.Equal(404, (int)response.StatusCode); + Assert.True(response.Headers.ContainsKey("Content-Type")); + Assert.Equal("application/json", response.Headers["Content-Type"][0]); + + Assert.Null(result); + Assert.Equal("{\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}", response.RawContent); + Assert.Equal("Not Found", response.ErrorText); + } + /// /// Test UpdatePet /// From ba4f40898bf64486497a6c962429eebec525f191 Mon Sep 17 00:00:00 2001 From: Luca Mazzanti Date: Tue, 4 May 2021 17:14:22 +0200 Subject: [PATCH 6/9] Refactored PetApiTest --- .../Org.OpenAPITools.sln | 13 +- .../Api/PetApiTestsV2.cs | 580 ++++++++++++++++++ .../Org.OpenAPITools.Test.csproj | 7 - .../aspnetcore-5.0/Org.OpenAPITools.sln | 35 +- 4 files changed, 607 insertions(+), 28 deletions(-) create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTestsV2.cs diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/Org.OpenAPITools.sln b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/Org.OpenAPITools.sln index 61278f3ea0b5..5508266f3487 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/Org.OpenAPITools.sln +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/Org.OpenAPITools.sln @@ -1,10 +1,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31129.286 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -24,4 +24,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection -EndGlobal \ No newline at end of file + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1545AFBB-0F19-491A-ABB2-9D981B80E9B8} + EndGlobalSection +EndGlobal diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTestsV2.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTestsV2.cs new file mode 100644 index 000000000000..0d52aab66b8e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTestsV2.cs @@ -0,0 +1,580 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System; +using System.Collections.Generic; +using System.IO; +using System.Net.Http; +using System.Reflection; +using System.Threading.Tasks; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing PetApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class PetApiTests : IDisposable + { + // CONFIGURE TESTING PARAMETERS HERE + private const string BasePath = "https://petstore.swagger.io/v2"; + private const string AccessToken = "special-key"; + private const long PetId = 100000; + private const long NotExistentId = 100001; + + private readonly HttpClient _httpClient = new HttpClient(); + private readonly PetApi _petApi; + + public PetApiTests() + { + // prepare the client + _petApi = new PetApi(_httpClient, new Configuration + { + BasePath = BasePath, + AccessToken = AccessToken, + Timeout = 10000, + UserAgent = "TEST_USER_AGENT" + }); + + // add a sample pet for the expected PetId + _petApi.AddPet(BuildSamplePet()); + + // ensure there is not a pet for that ID + try + { + _petApi.DeletePet(NotExistentId, AccessToken); + } + catch (ApiException ex) when (ex.ErrorCode == 404) { } + } + + #region Get + + /// + /// Test GetPetById with an existent Id + /// + [Fact] + public void GetPetById_GivenExistentId_ReturnsPet() + { + Pet expected = BuildSamplePet(); + + Pet response = _petApi.GetPetById(PetId); + + Assert.IsType(response); + Assert.Equal(expected.Name, response.Name); + Assert.Equal(expected.Status, response.Status); + Assert.IsType>(response.Tags); + Assert.Equal(expected.Tags[0].Id, response.Tags[0].Id); + Assert.Equal(expected.Tags[0].Name, response.Tags[0].Name); + Assert.IsType>(response.PhotoUrls); + Assert.Equal(expected.PhotoUrls[0], response.PhotoUrls[0]); + Assert.IsType(response.Category); + Assert.Equal(expected.Category.Id, response.Category.Id); + Assert.Equal(expected.Category.Name, response.Category.Name); + } + + /// + /// Test GetPetById with a not existent Id + /// + [Fact] + public void GetPetById_GivenNotExistentId_ThrowsApiException() + { + var exception = Assert.Throws(() => + { + _petApi.GetPetById(NotExistentId); + }); + + Assert.IsType(exception); + Assert.Equal(404, exception.ErrorCode); + Assert.Equal("{\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}", exception.ErrorContent); + Assert.Equal("Error calling GetPetById: {\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}", exception.Message); + } + + /// + /// Test GetPetByIdWithHttpInfo with an existent Id + /// + [Fact] + public void GetPetByIdWithHttpInfo_GivenExistentId_Returns200Response() + { + Pet expected = BuildSamplePet(); + + ApiResponse response = _petApi.GetPetByIdWithHttpInfo(PetId); + Pet result = response.Data; + + Assert.IsType>(response); + Assert.Equal(200, (int)response.StatusCode); + Assert.True(response.Headers.ContainsKey("Content-Type")); + Assert.Equal("application/json", response.Headers["Content-Type"][0]); + + Assert.Equal(expected.Name, result.Name); + Assert.Equal(expected.Status, result.Status); + Assert.IsType>(result.Tags); + Assert.Equal(expected.Tags[0].Id, result.Tags[0].Id); + Assert.Equal(expected.Tags[0].Name, result.Tags[0].Name); + Assert.IsType>(result.PhotoUrls); + Assert.Equal(expected.PhotoUrls[0], result.PhotoUrls[0]); + Assert.IsType(result.Category); + Assert.Equal(expected.Category.Id, result.Category.Id); + Assert.Equal(expected.Category.Name, result.Category.Name); + } + + /// + /// Test GetPetByIdWithHttpInfo with a not existent Id and the ExceptionFactory disabled + /// + [Fact] + public void GetPetByIdWithHttpInfo_GivenNotExistentId_ThrowsApiException() + { + var exception = Assert.Throws(() => + { + _petApi.GetPetByIdWithHttpInfo(NotExistentId); + }); + + Assert.IsType(exception); + Assert.Equal(404, exception.ErrorCode); + Assert.Equal("{\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}", exception.ErrorContent); + Assert.Equal("Error calling GetPetById: {\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}", exception.Message); + } + + /// + /// Test GetPetByIdWithHttpInfo with a not existent Id and the ExceptionFactory disabled + /// + [Fact] + public void GetPetByIdWithHttpInfo_WithoutExceptionFactory_GivenNotExistentId_Returns404Response() + { + _petApi.ExceptionFactory = null; + ApiResponse response = _petApi.GetPetByIdWithHttpInfo(NotExistentId); + Pet result = response.Data; + + Assert.IsType>(response); + Assert.Equal(404, (int)response.StatusCode); + Assert.True(response.Headers.ContainsKey("Content-Type")); + Assert.Equal("application/json", response.Headers["Content-Type"][0]); + + Assert.Null(result); + Assert.Equal("{\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}", response.RawContent); + Assert.Equal("Not Found", response.ErrorText); + } + + #endregion + + #region Get Async + + /// + /// Test GetPetByIdAsync with an existent Id. + /// + [Fact] + public async Task GetPetByIdAsync_GivenExistentId_ReturnsPet() + { + Pet expected = BuildSamplePet(); + + Pet response = await _petApi.GetPetByIdAsync(PetId); + + Assert.IsType(response); + Assert.Equal(expected.Name, response.Name); + Assert.Equal(expected.Status, response.Status); + Assert.IsType>(response.Tags); + Assert.Equal(expected.Tags[0].Id, response.Tags[0].Id); + Assert.Equal(expected.Tags[0].Name, response.Tags[0].Name); + Assert.IsType>(response.PhotoUrls); + Assert.Equal(expected.PhotoUrls[0], response.PhotoUrls[0]); + Assert.IsType(response.Category); + Assert.Equal(expected.Category.Id, response.Category.Id); + Assert.Equal(expected.Category.Name, response.Category.Name); + } + + /// + /// Test GetPetByIdAsync with a not existent Id. + /// + [Fact] + public async Task GetPetByIdAsync_GivenNotExistentId_ThrowsApiException() + { + var exception = await Assert.ThrowsAsync(() => _petApi.GetPetByIdAsync(NotExistentId)); + + Assert.IsType(exception); + Assert.Equal(404, exception.ErrorCode); + Assert.Equal("{\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}", exception.ErrorContent); + Assert.Equal("Error calling GetPetById: {\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}", exception.Message); + } + + /// + /// Test GetPetByIdWithHttpInfoAsync with an existent Id. + /// + [Fact] + public async Task GetPetByIdWithHttpInfoAsync_GivenExistentId_Returns200Response() + { + Pet expected = BuildSamplePet(); + + ApiResponse response = await _petApi.GetPetByIdWithHttpInfoAsync(PetId); + Pet result = response.Data; + + Assert.IsType>(response); + Assert.Equal(200, (int)response.StatusCode); + Assert.True(response.Headers.ContainsKey("Content-Type")); + Assert.Equal("application/json", response.Headers["Content-Type"][0]); + + Assert.Equal(expected.Name, result.Name); + Assert.Equal(expected.Status, result.Status); + Assert.IsType>(result.Tags); + Assert.Equal(expected.Tags[0].Id, result.Tags[0].Id); + Assert.Equal(expected.Tags[0].Name, result.Tags[0].Name); + Assert.IsType>(result.PhotoUrls); + Assert.Equal(expected.PhotoUrls[0], result.PhotoUrls[0]); + Assert.IsType(result.Category); + Assert.Equal(expected.Category.Id, result.Category.Id); + Assert.Equal(expected.Category.Name, result.Category.Name); + } + + /// + /// Test GetPetByIdWithHttpInfoAsync with a not existent Id and the ExceptionFactory disabled. + /// + [Fact] + public async Task GetPetByIdWithHttpInfoAsync_GivenNotExistentId_ThrowsApiException() + { + var exception = await Assert.ThrowsAsync(() => _petApi.GetPetByIdWithHttpInfoAsync(NotExistentId)); + + Assert.IsType(exception); + Assert.Equal(404, exception.ErrorCode); + Assert.Equal("{\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}", exception.ErrorContent); + Assert.Equal("Error calling GetPetById: {\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}", exception.Message); + } + + /// + /// Test GetPetByIdWithHttpInfoAsync with a not existent Id and the ExceptionFactory disabled. + /// + [Fact] + public async Task GetPetByIdWithHttpInfoAsync_WithoutExceptionFactory_GivenNotExistentId_Returns404Response() + { + _petApi.ExceptionFactory = null; + ApiResponse response = await _petApi.GetPetByIdWithHttpInfoAsync(NotExistentId); + Pet result = response.Data; + + Assert.IsType>(response); + Assert.Equal(404, (int)response.StatusCode); + Assert.True(response.Headers.ContainsKey("Content-Type")); + Assert.Equal("application/json", response.Headers["Content-Type"][0]); + + Assert.Null(result); + Assert.Equal("{\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}", response.RawContent); + Assert.Equal("Not Found", response.ErrorText); + } + + #endregion + + #region Find + + /// + /// Test FindPetsByStatus filtering available pets. + /// + [Fact(Skip = "too much elements to fetch, the server cut the json content")] + public void FindPetsByStatus_ReturnsListOfPetsFiltered() + { + List pets = _petApi.FindPetsByStatus(new List(new[] { "available" })); + + foreach (Pet pet in pets) + { + Assert.IsType(pet); + Assert.Equal(Pet.StatusEnum.Available, pet.Status); + } + } + + #endregion + + #region Add + + /// + /// Test AddPet with an existent Id. The current server beavior is to update the Pet. + /// + [Fact] + public void AddPet_GivenExistentId_UpdateThePet() + { + Pet pet = BuildSamplePet(); + + _petApi.AddPet(pet); + } + + #endregion + + #region AddAsync + + /// + /// Test AddPetAsync with an existent Id. The current server beavior is to update the Pet. + /// + [Fact] + public async Task AddPetAsync_GivenExistentId_UpdateThePet() + { + Pet pet = BuildSamplePet(); + + await _petApi.AddPetAsync(pet); + } + + #endregion + + #region Update + + /// + /// Test UpdatePet with an existent Id. + /// + [Fact] + public void UpdatePet_GivenExistentId_UpdateThePet() + { + Pet pet = BuildSamplePet(); + + _petApi.UpdatePet(pet); + } + + /// + /// Test UpdatePet with a not existent Id. The current server beavior is to create the Pet. + /// + [Fact] + public void UpdatePet_GivenNotExistentId_UpdateThePet() + { + Pet pet = BuildSamplePet(i => i.Id = NotExistentId); + + _petApi.UpdatePet(pet); + } + + /// + /// Test UpdatePetWithForm with an existent Id. + /// + [Fact] + public void UpdatePetWithForm_GivenExistentId_UpdatesTheFields() + { + Pet expected = BuildSamplePet(pet => + { + pet.Name = "name updated"; + pet.Status = Pet.StatusEnum.Pending; + }); + + _petApi.UpdatePetWithForm(PetId, "name updated", "pending"); + + Pet response = _petApi.GetPetById(PetId); + + Assert.IsType(response); + Assert.Equal(expected.Name, response.Name); + Assert.Equal(expected.Status, response.Status); + Assert.IsType>(response.Tags); + Assert.Equal(expected.Tags[0].Id, response.Tags[0].Id); + Assert.Equal(expected.Tags[0].Name, response.Tags[0].Name); + Assert.IsType>(response.PhotoUrls); + Assert.Equal(expected.PhotoUrls[0], response.PhotoUrls[0]); + Assert.IsType(response.Category); + Assert.Equal(expected.Category.Id, response.Category.Id); + Assert.Equal(expected.Category.Name, response.Category.Name); + + _petApi.UpdatePetWithForm(PetId, "name updated twice"); + + response = _petApi.GetPetById(PetId); + + Assert.Equal("name updated twice", response.Name); + } + + /// + /// Test UploadFile with an existent Id. + /// + [Fact(Skip = "generates 500 code at the time of test")] + public void UploadFile_UploadFileUsingFormParameters_UpdatesTheFields() + { + var assembly = Assembly.GetExecutingAssembly(); + using Stream imageStream = assembly.GetManifestResourceStream("Org.OpenAPITools.Test.linux-logo.png"); + _petApi.UploadFile(PetId, "metadata sample", imageStream); + } + + /// + /// Test UploadFile with an existent Id. + /// + [Fact(Skip = "generates 500 code at the time of test")] + public void UploadFile_UploadFileAlone_UpdatesTheField() + { + var assembly = Assembly.GetExecutingAssembly(); + using Stream imageStream = assembly.GetManifestResourceStream("Org.OpenAPITools.Test.linux-logo.png"); + _petApi.UploadFile(petId: PetId, file: imageStream); + } + + #endregion + + #region UpdateAsync + + /// + /// Test UpdatePetAsync with an existent Id. + /// + [Fact] + public async Task UpdatePetAsync_GivenExistentId_UpdateThePet() + { + Pet pet = BuildSamplePet(); + + await _petApi.UpdatePetAsync(pet); + } + + /// + /// Test UpdatePetAsync with a not existent Id. The current server beavior is to create the Pet. + /// + [Fact] + public async Task UpdatePetAsync_GivenNotExistentId_UpdateThePet() + { + Pet pet = BuildSamplePet(i => i.Id = NotExistentId); + + await _petApi.UpdatePetAsync(pet); + } + + /// + /// Test UpdatePetWithFormAsync with an existent Id. + /// + [Fact] + public async Task UpdatePetWithFormAsync_GivenExistentId_UpdatesTheFields() + { + Pet expected = BuildSamplePet(pet => + { + pet.Name = "name updated"; + pet.Status = Pet.StatusEnum.Pending; + }); + + await _petApi.UpdatePetWithFormAsync(PetId, "name updated", "pending"); + + Pet response = await _petApi.GetPetByIdAsync(PetId); + + Assert.IsType(response); + Assert.Equal(expected.Name, response.Name); + Assert.Equal(expected.Status, response.Status); + Assert.IsType>(response.Tags); + Assert.Equal(expected.Tags[0].Id, response.Tags[0].Id); + Assert.Equal(expected.Tags[0].Name, response.Tags[0].Name); + Assert.IsType>(response.PhotoUrls); + Assert.Equal(expected.PhotoUrls[0], response.PhotoUrls[0]); + Assert.IsType(response.Category); + Assert.Equal(expected.Category.Id, response.Category.Id); + Assert.Equal(expected.Category.Name, response.Category.Name); + + await _petApi.UpdatePetWithFormAsync(PetId, "name updated twice"); + + response = await _petApi.GetPetByIdAsync(PetId); + + Assert.Equal("name updated twice", response.Name); + } + + /// + /// Test UploadFileAsync with an existent Id. + /// + [Fact(Skip = "generates 500 code at the time of test")] + public async Task UploadFileAsync_UploadFileUsingFormParameters_UpdatesTheFields() + { + var assembly = Assembly.GetExecutingAssembly(); + await using Stream imageStream = assembly.GetManifestResourceStream("Org.OpenAPITools.Test.linux-logo.png"); + await _petApi.UploadFileAsync(PetId, "metadata sample", imageStream); + } + + /// + /// Test UploadFileAsync with an existent Id. + /// + [Fact(Skip = "generates 500 code at the time of test")] + public async Task UploadFileAsync_UploadFileAlone_UpdatesTheField() + { + var assembly = Assembly.GetExecutingAssembly(); + await using Stream imageStream = assembly.GetManifestResourceStream("Org.OpenAPITools.Test.linux-logo.png"); + await _petApi.UploadFileAsync(petId: PetId, file: imageStream); + } + + #endregion + + #region Delete + + /// + /// Test DeletePet with an existent Id. + /// + [Fact] + public void DeletePet_GivenExistentId_DeleteThePet() + { + _petApi.DeletePet(PetId); + + var exception = Assert.Throws(() => _petApi.GetPetById(PetId)); + + Assert.IsType(exception); + Assert.Equal(404, exception.ErrorCode); + } + + /// + /// Test DeletePet with a not existent Id. The current server beavior is to return 404. + /// + [Fact] + public void DeletePet_GivenNotExistentId_ThrowsApiException() + { + var exception = Assert.Throws(() => _petApi.DeletePet(NotExistentId)); + + Assert.IsType(exception); + Assert.Equal(404, exception.ErrorCode); + } + + #endregion + + #region DeleteAsync + + /// + /// Test DeletePet with an existent Id. + /// + [Fact] + public async Task DeletePetAsync_GivenExistentId_DeleteThePet() + { + await _petApi.DeletePetAsync(PetId); + + var exception = Assert.Throws(() => _petApi.GetPetById(PetId)); + + Assert.IsType(exception); + Assert.Equal(404, exception.ErrorCode); + } + + /// + /// Test DeletePet with a not existent Id. The current server beavior is to return 404. + /// + [Fact] + public async Task DeletePetAsync_GivenNotExistentId_ThrowsApiException() + { + var exception = await Assert.ThrowsAsync(() => _petApi.DeletePetAsync(NotExistentId)); + + Assert.IsType(exception); + Assert.Equal(404, exception.ErrorCode); + } + + #endregion + + private static Pet BuildSamplePet(Action callback = null) + { + var pet = new Pet( + name: "csharp test", + photoUrls: new List { "http://petstore.com/csharp_test" }) + { + Id = PetId, + Status = Pet.StatusEnum.Available, + Category = new Category { Id = 10, Name = "sample category" }, + Tags = new List { new Tag { Id = 100, Name = "sample tag" } } + }; + + callback?.Invoke(pet); + + return pet; + } + + public void Dispose() + { + // remove the pet after testing + try + { + _petApi.DeletePet(PetId, AccessToken); + } + catch (ApiException ex) when (ex.ErrorCode == 404) { } + + _petApi.Dispose(); + _httpClient.Dispose(); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index dcc1208d75cf..e44ebdd648a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -8,7 +8,6 @@ - @@ -17,10 +16,4 @@ - - - - - - diff --git a/samples/server/petstore/aspnetcore-5.0/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-5.0/Org.OpenAPITools.sln index c2bc38764202..139231e41f61 100644 --- a/samples/server/petstore/aspnetcore-5.0/Org.OpenAPITools.sln +++ b/samples/server/petstore/aspnetcore-5.0/Org.OpenAPITools.sln @@ -1,22 +1,25 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27428.2043 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31129.286 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" EndProject Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6AC7DED5-0F52-4187-9BC1-74437AAEE42D} + EndGlobalSection EndGlobal From 29c57a51617945d12105e102145e74f5cf9056cf Mon Sep 17 00:00:00 2001 From: Luca Mazzanti Date: Tue, 4 May 2021 17:20:01 +0200 Subject: [PATCH 7/9] Updated samples --- .../OpenAPIClient-httpclient/Org.OpenAPITools.sln | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/Org.OpenAPITools.sln b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/Org.OpenAPITools.sln index 5508266f3487..61278f3ea0b5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/Org.OpenAPITools.sln +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/Org.OpenAPITools.sln @@ -1,10 +1,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31129.286 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -24,7 +24,4 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {1545AFBB-0F19-491A-ABB2-9D981B80E9B8} - EndGlobalSection -EndGlobal +EndGlobal \ No newline at end of file From 3aac63d45bad8395fa1a372f1092cbcc700bf066 Mon Sep 17 00:00:00 2001 From: Luca Mazzanti Date: Wed, 5 May 2021 11:04:54 +0200 Subject: [PATCH 8/9] Fixed test issues --- .../src/Org.OpenAPITools.Test/Api/PetApiTests.cs | 1 - .../src/Org.OpenAPITools.Test/Api/PetApiTestsV2.cs | 13 ++++++------- .../Org.OpenAPITools.Test.csproj | 8 ++++++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs index ef48856396dc..83b978b93011 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -206,7 +206,6 @@ public void TestGetPetByIdAsync() public void TestGetPetById_TestException() { PetApi petApi = new PetApi(); - var task = petApi.GetPetById(notExsistentPetId); var exception = Assert.Throws(() => { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTestsV2.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTestsV2.cs index 0d52aab66b8e..e00f3d614671 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTestsV2.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Api/PetApiTestsV2.cs @@ -27,24 +27,23 @@ namespace Org.OpenAPITools.Test.Api /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). /// Please update the test case below to test the API endpoint. /// - public class PetApiTests : IDisposable + public class PetApiTestsV2 : IDisposable { // CONFIGURE TESTING PARAMETERS HERE - private const string BasePath = "https://petstore.swagger.io/v2"; - private const string AccessToken = "special-key"; + // see the Integration Test Wiki for details: https://github.com/OpenAPITools/openapi-generator/wiki/Integration-Tests + private const string BasePath = "http://petstore.swagger.io/v2"; private const long PetId = 100000; private const long NotExistentId = 100001; private readonly HttpClient _httpClient = new HttpClient(); private readonly PetApi _petApi; - public PetApiTests() + public PetApiTestsV2() { // prepare the client _petApi = new PetApi(_httpClient, new Configuration { BasePath = BasePath, - AccessToken = AccessToken, Timeout = 10000, UserAgent = "TEST_USER_AGENT" }); @@ -55,7 +54,7 @@ public PetApiTests() // ensure there is not a pet for that ID try { - _petApi.DeletePet(NotExistentId, AccessToken); + _petApi.DeletePet(NotExistentId); } catch (ApiException ex) when (ex.ErrorCode == 404) { } } @@ -569,7 +568,7 @@ public void Dispose() // remove the pet after testing try { - _petApi.DeletePet(PetId, AccessToken); + _petApi.DeletePet(PetId); } catch (ApiException ex) when (ex.ErrorCode == 404) { } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index e44ebdd648a5..20f33144c2a7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -7,6 +7,10 @@ false + + + + @@ -16,4 +20,8 @@ + + + + From df32f0ae256166f137c5cc21ead6a02f72fb1039 Mon Sep 17 00:00:00 2001 From: Luca Mazzanti Date: Wed, 5 May 2021 13:27:08 +0200 Subject: [PATCH 9/9] reverted previous commit --- .../aspnetcore-5.0/Org.OpenAPITools.sln | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/samples/server/petstore/aspnetcore-5.0/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-5.0/Org.OpenAPITools.sln index 139231e41f61..c2bc38764202 100644 --- a/samples/server/petstore/aspnetcore-5.0/Org.OpenAPITools.sln +++ b/samples/server/petstore/aspnetcore-5.0/Org.OpenAPITools.sln @@ -1,25 +1,22 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31129.286 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2043 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" EndProject Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {6AC7DED5-0F52-4187-9BC1-74437AAEE42D} - EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection EndGlobal