diff --git a/APIMatic.Core.Test/APIMatic.Core.Test.csproj b/APIMatic.Core.Test/APIMatic.Core.Test.csproj index 6f35c45a..8a7392de 100644 --- a/APIMatic.Core.Test/APIMatic.Core.Test.csproj +++ b/APIMatic.Core.Test/APIMatic.Core.Test.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 false diff --git a/APIMatic.Core.Test/Api/HttpGet/ApiCallGetDynamicError.cs b/APIMatic.Core.Test/Api/HttpGet/ApiCallGetDynamicError.cs index 67fd9b3e..3cd553cd 100644 --- a/APIMatic.Core.Test/Api/HttpGet/ApiCallGetDynamicError.cs +++ b/APIMatic.Core.Test/Api/HttpGet/ApiCallGetDynamicError.cs @@ -14,7 +14,7 @@ namespace APIMatic.Core.Test.Api.HttpGet { [TestFixture] - internal class ApiCallGetDynamicError : ApiCallTest + internal sealed class ApiCallGetDynamicError : ApiCallTest { [Test] public void ApiCall_GetDynamicError_Local_501StausCode() diff --git a/APIMatic.Core.Test/Api/HttpGet/ApiCallGetTest.cs b/APIMatic.Core.Test/Api/HttpGet/ApiCallGetTest.cs index ab408a1c..2f7525d4 100644 --- a/APIMatic.Core.Test/Api/HttpGet/ApiCallGetTest.cs +++ b/APIMatic.Core.Test/Api/HttpGet/ApiCallGetTest.cs @@ -679,7 +679,7 @@ public void ApiCall_GetNumber_MissingContent() // Act and Assert var exp = Assert.Throws(() => CoreHelper.RunTask(apiCall)); - Assert.AreEqual("Input string was not in a correct format.", exp.Message); + Assert.AreEqual("The input string '' was not in a correct format.", exp.Message); } [Test] diff --git a/APIMatic.Core.Test/Api/HttpPost/ApiCallPostContainerTest.cs b/APIMatic.Core.Test/Api/HttpPost/ApiCallPostContainerTest.cs index 21abf68e..46580214 100644 --- a/APIMatic.Core.Test/Api/HttpPost/ApiCallPostContainerTest.cs +++ b/APIMatic.Core.Test/Api/HttpPost/ApiCallPostContainerTest.cs @@ -10,7 +10,7 @@ namespace APIMatic.Core.Test.Api.HttpPost { [TestFixture] - internal class ApiCallPostContainerTest : ApiCallTest + internal sealed class ApiCallPostContainerTest : ApiCallTest { [Test] public void ApiCall_PostModelAsContainerData_OKResponse() diff --git a/APIMatic.Core.Test/Api/HttpPost/ApiCallPostFileTest.cs b/APIMatic.Core.Test/Api/HttpPost/ApiCallPostFileTest.cs index 7b78bf21..3f48373f 100644 --- a/APIMatic.Core.Test/Api/HttpPost/ApiCallPostFileTest.cs +++ b/APIMatic.Core.Test/Api/HttpPost/ApiCallPostFileTest.cs @@ -14,7 +14,7 @@ namespace APIMatic.Core.Test.Api.HttpPost { [TestFixture] - internal class ApiCallPostFileTest : ApiCallTest + internal sealed class ApiCallPostFileTest : ApiCallTest { [Test] public void ApiCall_PostFileData_OKResponse() diff --git a/APIMatic.Core.Test/Api/HttpPost/ApiCallPostStreamTest.cs b/APIMatic.Core.Test/Api/HttpPost/ApiCallPostStreamTest.cs index 66df14de..a5605559 100644 --- a/APIMatic.Core.Test/Api/HttpPost/ApiCallPostStreamTest.cs +++ b/APIMatic.Core.Test/Api/HttpPost/ApiCallPostStreamTest.cs @@ -11,7 +11,7 @@ namespace APIMatic.Core.Test.Api.HttpPost { [TestFixture] - internal class ApiCallPostStreamTest : ApiCallTest + internal sealed class ApiCallPostStreamTest : ApiCallTest { [Test] public void ApiCall_PostBodyStream_OKResponse() diff --git a/APIMatic.Core.Test/Api/HttpPost/ApiCallPostTest.cs b/APIMatic.Core.Test/Api/HttpPost/ApiCallPostTest.cs index f44cd4ee..00715f08 100644 --- a/APIMatic.Core.Test/Api/HttpPost/ApiCallPostTest.cs +++ b/APIMatic.Core.Test/Api/HttpPost/ApiCallPostTest.cs @@ -13,7 +13,7 @@ namespace APIMatic.Core.Test.Api.HttpPost { [TestFixture] - internal class ApiCallPostTest : ApiCallTest + internal sealed class ApiCallPostTest : ApiCallTest { [Test] public void ApiCall_PostBody_OKResponse() diff --git a/APIMatic.Core.Test/Api/HttpPost/ApiCallPostXmlTest.cs b/APIMatic.Core.Test/Api/HttpPost/ApiCallPostXmlTest.cs index 7b24cc8d..bce27d94 100644 --- a/APIMatic.Core.Test/Api/HttpPost/ApiCallPostXmlTest.cs +++ b/APIMatic.Core.Test/Api/HttpPost/ApiCallPostXmlTest.cs @@ -9,7 +9,7 @@ namespace APIMatic.Core.Test.Api.HttpPost { [TestFixture] - internal class ApiCallPostXmlTest : ApiCallTest + internal sealed class ApiCallPostXmlTest : ApiCallTest { [Test] public void ApiCall_PostXmlLong_OKResponse() diff --git a/APIMatic.Core.Test/AuthenticationTest.cs b/APIMatic.Core.Test/AuthenticationTest.cs index 4cf147b9..d3c3c923 100644 --- a/APIMatic.Core.Test/AuthenticationTest.cs +++ b/APIMatic.Core.Test/AuthenticationTest.cs @@ -139,17 +139,19 @@ public void Multiple_Authentication_AND_Validation_Failure() "-> Missing required header field: TOKEN", exp.Message); } - [Test] - public void Multiple_Authentication_AND_All_Missing_Validation_Failure() - { - var expectedLines = new[] - { - "Following authentication credentials are required:", + private static readonly string[] sourceArray = + [ + "Following authentication credentials are required:", "-> Missing required query field: API-KEY", "-> Missing required query field: TOKEN", "-> Missing required header field: API-KEY", "-> Missing required header field: TOKEN" - }.OrderBy(line => line); + ]; + + [Test] + public void Multiple_Authentication_AND_All_Missing_Validation_Failure() + { + var expectedLines = sourceArray.OrderBy(line => line); var globalConfiguration = new GlobalConfiguration.Builder() .ServerUrls(new Dictionary diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/ArrayOfMapContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/ArrayOfMapContainer.cs index 955c4e65..f783369c 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/ArrayOfMapContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/ArrayOfMapContainer.cs @@ -28,7 +28,7 @@ public static ArrayOfMapContainer Fromorbit(List> valu public abstract T Match(Func>, T> atom, Func>, T> orbit); [JsonConverter(typeof(UnionTypeCaseConverter>>))] - private class AtomCase : ArrayOfMapContainer, ICaseValue>> + private sealed class AtomCase : ArrayOfMapContainer, ICaseValue>> { public List> value; @@ -54,7 +54,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter>>))] - private class OrbitCase : ArrayOfMapContainer, ICaseValue>> + private sealed class OrbitCase : ArrayOfMapContainer, ICaseValue>> { public List> value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/CustomAnyOfContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/CustomAnyOfContainer.cs index aa234eb2..09d84325 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/CustomAnyOfContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/CustomAnyOfContainer.cs @@ -27,7 +27,7 @@ public static CustomAnyOfContainer FromOrbit(Orbit value) public abstract T Match(Func atom, Func orbit); [JsonConverter(typeof(UnionTypeCaseConverter))] - private class AtomCase : CustomAnyOfContainer, ICaseValue + private sealed class AtomCase : CustomAnyOfContainer, ICaseValue { public Atom value; @@ -53,7 +53,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter))] - private class OrbitCase : CustomAnyOfContainer, ICaseValue + private sealed class OrbitCase : CustomAnyOfContainer, ICaseValue { public Orbit value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/CustomNestedOneOfContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/CustomNestedOneOfContainer.cs index 72c59eda..183687f1 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/CustomNestedOneOfContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/CustomNestedOneOfContainer.cs @@ -27,7 +27,7 @@ public static CustomNestedOneOfContainer Fromorbit(NativeOneOfContainer value) public abstract T Match(Func atom, Func nestedOneOf); [JsonConverter(typeof(UnionTypeCaseConverter))] - private class AtomCase : CustomNestedOneOfContainer, ICaseValue + private sealed class AtomCase : CustomNestedOneOfContainer, ICaseValue { public Atom value; @@ -54,7 +54,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter))] - private class OrbitCase : CustomNestedOneOfContainer, ICaseValue + private sealed class OrbitCase : CustomNestedOneOfContainer, ICaseValue { public NativeOneOfContainer value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/CustomOneOfCollectionContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/CustomOneOfCollectionContainer.cs index dd1c331c..4998e27c 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/CustomOneOfCollectionContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/CustomOneOfCollectionContainer.cs @@ -27,7 +27,7 @@ public static CustomOneOfCollectionContainer Fromorbit(Orbit[] value) public abstract T Match(Func atom, Func orbit); [JsonConverter(typeof(UnionTypeCaseConverter))] - private class AtomCase : CustomOneOfCollectionContainer, ICaseValue + private sealed class AtomCase : CustomOneOfCollectionContainer, ICaseValue { public Atom[] value; @@ -53,7 +53,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter))] - private class OrbitCase : CustomOneOfCollectionContainer, ICaseValue + private sealed class OrbitCase : CustomOneOfCollectionContainer, ICaseValue { public Orbit[] value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/CustomOneOfContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/CustomOneOfContainer.cs index a247ee25..6f2653b4 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/CustomOneOfContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/CustomOneOfContainer.cs @@ -27,7 +27,7 @@ public static CustomOneOfContainer Fromorbit(Orbit value) public abstract T Match(Func atom, Func orbit); [JsonConverter(typeof(UnionTypeCaseConverter))] - private class AtomCase : CustomOneOfContainer, ICaseValue + private sealed class AtomCase : CustomOneOfContainer, ICaseValue { public Atom value; @@ -54,7 +54,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter))] - private class OrbitCase : CustomOneOfContainer, ICaseValue + private sealed class OrbitCase : CustomOneOfContainer, ICaseValue { public Orbit value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/CustomOneOfWithDiscContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/CustomOneOfWithDiscContainer.cs index 96676726..13572347 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/CustomOneOfWithDiscContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/CustomOneOfWithDiscContainer.cs @@ -33,7 +33,7 @@ public static CustomOneOfWithDiscContainer FromHelium(Helium value) public abstract T Match(Func atom, Func helium); [JsonConverter(typeof(UnionTypeCaseConverter))] - private class AtomCase : CustomOneOfWithDiscContainer, ICaseValue + private sealed class AtomCase : CustomOneOfWithDiscContainer, ICaseValue { public Atom value; @@ -60,7 +60,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter))] - private class HeliumCase : CustomOneOfWithDiscContainer, ICaseValue + private sealed class HeliumCase : CustomOneOfWithDiscContainer, ICaseValue { public Helium value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/EnumAnyOfContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/EnumAnyOfContainer.cs index 8a178053..3665f619 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/EnumAnyOfContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/EnumAnyOfContainer.cs @@ -33,7 +33,7 @@ public static EnumAnyOfContainer FromMonthNumber(MonthNumber value) public abstract T Match(Func workingDays, Func days, Func monthNumber); [JsonConverter(typeof(UnionTypeCaseConverter))] - private class WorkingDaysCase : EnumAnyOfContainer, ICaseValue + private sealed class WorkingDaysCase : EnumAnyOfContainer, ICaseValue { public WorkingDays value; @@ -60,7 +60,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter))] - private class DaysCase : EnumAnyOfContainer, ICaseValue + private sealed class DaysCase : EnumAnyOfContainer, ICaseValue { public Days value; @@ -87,7 +87,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter))] - private class MonthNumberCase : EnumAnyOfContainer, ICaseValue + private sealed class MonthNumberCase : EnumAnyOfContainer, ICaseValue { public MonthNumber value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/MapOfArrayContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/MapOfArrayContainer.cs index dba04d21..fa98f754 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/MapOfArrayContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/MapOfArrayContainer.cs @@ -28,7 +28,7 @@ public static MapOfArrayContainer Fromorbit(Dictionary> valu public abstract T Match(Func>, T> atomDictionay, Func>, T> orbitsDictionay); [JsonConverter(typeof(UnionTypeCaseConverter>>))] - private class AtomCase : MapOfArrayContainer, ICaseValue>> + private sealed class AtomCase : MapOfArrayContainer, ICaseValue>> { public Dictionary> value; @@ -54,7 +54,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter>>))] - private class OrbitCase : MapOfArrayContainer, ICaseValue>> + private sealed class OrbitCase : MapOfArrayContainer, ICaseValue>> { public Dictionary> value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/NativeAnyOfCollectionContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/NativeAnyOfCollectionContainer.cs index 956cd67c..62e9a55a 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/NativeAnyOfCollectionContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/NativeAnyOfCollectionContainer.cs @@ -28,7 +28,7 @@ public static NativeAnyOfCollectionContainer FromMString(string[] value) public abstract T Match(Func precisionArray, Func mStringArray); [JsonConverter(typeof(UnionTypeCaseConverter), JTokenType.Float)] - private class PrecisionArrayCase : NativeAnyOfCollectionContainer, ICaseValue + private sealed class PrecisionArrayCase : NativeAnyOfCollectionContainer, ICaseValue { public double[] value; @@ -55,7 +55,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter), JTokenType.String)] - private class MStringArrayCase : NativeAnyOfCollectionContainer, ICaseValue + private sealed class MStringArrayCase : NativeAnyOfCollectionContainer, ICaseValue { public string[] value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/NativeAnyOfContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/NativeAnyOfContainer.cs index 9bd4a444..2c82253a 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/NativeAnyOfContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/NativeAnyOfContainer.cs @@ -28,7 +28,7 @@ public static NativeAnyOfContainer FromString(string value) public abstract T Match(Func precision, Func mString); [JsonConverter(typeof(UnionTypeCaseConverter), JTokenType.Float)] - private class PrecisionCase : NativeAnyOfContainer, ICaseValue + private sealed class PrecisionCase : NativeAnyOfContainer, ICaseValue { public double value; @@ -54,7 +54,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter), JTokenType.String)] - private class StringCase : NativeAnyOfContainer, ICaseValue + private sealed class StringCase : NativeAnyOfContainer, ICaseValue { public string value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/NativeDateTimeAnyOfContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/NativeDateTimeAnyOfContainer.cs index 7175b73d..2020956b 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/NativeDateTimeAnyOfContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/NativeDateTimeAnyOfContainer.cs @@ -29,7 +29,7 @@ public static NativeDateTimeAnyOfContainer FromRFC3339DateTime(DateTime value) public abstract T Match(Func rfc1123DateTime, Func rfc3339DateTime); [JsonConverter(typeof(UnionTypeCaseConverter), JTokenType.Date)] - private class DateTimeCase : NativeDateTimeAnyOfContainer, ICaseValue, ICustomConverter + private sealed class DateTimeCase : NativeDateTimeAnyOfContainer, ICaseValue, ICustomConverter { public DateTime? value; @@ -61,7 +61,7 @@ public JsonConverter GetJsonConverter() } [JsonConverter(typeof(UnionTypeCaseConverter), JTokenType.Date)] - private class DateTimeCase2 : NativeDateTimeAnyOfContainer, ICaseValue, ICustomConverter + private sealed class DateTimeCase2 : NativeDateTimeAnyOfContainer, ICaseValue, ICustomConverter { public DateTime? value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/NativeNullableOneOfContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/NativeNullableOneOfContainer.cs index 12e680b6..a5473659 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/NativeNullableOneOfContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/NativeNullableOneOfContainer.cs @@ -28,7 +28,7 @@ public static NativeNullableOneOfContainer FromMString(string value) public abstract T Match(Func precision, Func mString); [JsonConverter(typeof(UnionTypeCaseConverter), JTokenType.Float, JTokenType.Null)] - private class PrecisionCase : NativeNullableOneOfContainer, ICaseValue + private sealed class PrecisionCase : NativeNullableOneOfContainer, ICaseValue { public double? value; @@ -54,7 +54,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter), JTokenType.String)] - private class MStringCase : NativeNullableOneOfContainer, ICaseValue + private sealed class MStringCase : NativeNullableOneOfContainer, ICaseValue { public string value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/NativeOneOfCollectionContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/NativeOneOfCollectionContainer.cs index fa25256a..ca90c617 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/NativeOneOfCollectionContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/NativeOneOfCollectionContainer.cs @@ -35,7 +35,7 @@ public static NativeOneOfCollectionContainer FromCutomTypeDictionary(Dictionary< public abstract T Match(Func precision, Func mString, Func, T> customTypeDictionay); [JsonConverter(typeof(UnionTypeCaseConverter), JTokenType.Float)] - private class PrecisionArrayCase : NativeOneOfCollectionContainer, ICaseValue + private sealed class PrecisionArrayCase : NativeOneOfCollectionContainer, ICaseValue { public double[] value; @@ -62,7 +62,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter), JTokenType.String)] - private class MStringArrayCase : NativeOneOfCollectionContainer, ICaseValue + private sealed class MStringArrayCase : NativeOneOfCollectionContainer, ICaseValue { public string[] value; @@ -89,7 +89,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter>))] - private class CustomTypeDictionaryCase : NativeOneOfCollectionContainer, ICaseValue> + private sealed class CustomTypeDictionaryCase : NativeOneOfCollectionContainer, ICaseValue> { public Dictionary value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/NativeOneOfContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/NativeOneOfContainer.cs index c9e0b7b0..6fa67444 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/NativeOneOfContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/NativeOneOfContainer.cs @@ -28,7 +28,7 @@ public static NativeOneOfContainer FromMString(string value) public abstract T Match(Func precision, Func mString); [JsonConverter(typeof(UnionTypeCaseConverter), JTokenType.Float)] - private class PrecisionCase : NativeOneOfContainer, ICaseValue + private sealed class PrecisionCase : NativeOneOfContainer, ICaseValue { public double value; @@ -55,7 +55,7 @@ public override string ToString() } [JsonConverter(typeof(UnionTypeCaseConverter), JTokenType.String)] - private class MStringCase : NativeOneOfContainer, ICaseValue + private sealed class MStringCase : NativeOneOfContainer, ICaseValue { public string value; diff --git a/APIMatic.Core.Test/MockTypes/Models/Containers/TestContainer.cs b/APIMatic.Core.Test/MockTypes/Models/Containers/TestContainer.cs index 239aa692..a61fa091 100644 --- a/APIMatic.Core.Test/MockTypes/Models/Containers/TestContainer.cs +++ b/APIMatic.Core.Test/MockTypes/Models/Containers/TestContainer.cs @@ -26,7 +26,7 @@ public static NativeOneOfContainer FromMString(string value) public abstract T Match(Func precision, Func mString); - private class PrecisionCase : NativeOneOfContainer, ICaseValue + private sealed class PrecisionCase : NativeOneOfContainer, ICaseValue { public double value; @@ -52,7 +52,7 @@ public override string ToString() } } - private class MStringCase : NativeOneOfContainer, ICaseValue + private sealed class MStringCase : NativeOneOfContainer, ICaseValue { public string value; diff --git a/APIMatic.Core.Test/MockTypes/Models/ServerResponse.cs b/APIMatic.Core.Test/MockTypes/Models/ServerResponse.cs index 3ba0a760..1e9e5855 100644 --- a/APIMatic.Core.Test/MockTypes/Models/ServerResponse.cs +++ b/APIMatic.Core.Test/MockTypes/Models/ServerResponse.cs @@ -3,7 +3,7 @@ namespace APIMatic.Core.Test.MockTypes.Models { - internal class ServerResponse : BaseModel + internal sealed class ServerResponse : BaseModel { /// /// Initializes a new instance of the class. diff --git a/APIMatic.Core.Test/MockTypes/Models/TestModelB.cs b/APIMatic.Core.Test/MockTypes/Models/TestModelB.cs index ce095c64..25a37bf1 100644 --- a/APIMatic.Core.Test/MockTypes/Models/TestModelB.cs +++ b/APIMatic.Core.Test/MockTypes/Models/TestModelB.cs @@ -4,7 +4,7 @@ namespace APIMatic.Core.Test.MockTypes.Models { - internal class TestModelB + internal sealed class TestModelB { [JsonConverter(typeof(CustomDateTimeConverter), "yyyy'-'MM'-'dd")] public DateTime TestDateTime { get; set; } diff --git a/APIMatic.Core.Test/MockTypes/Models/TestModelC.cs b/APIMatic.Core.Test/MockTypes/Models/TestModelC.cs index 3b80ae8d..11226d39 100644 --- a/APIMatic.Core.Test/MockTypes/Models/TestModelC.cs +++ b/APIMatic.Core.Test/MockTypes/Models/TestModelC.cs @@ -3,7 +3,7 @@ namespace APIMatic.Core.Test.MockTypes.Models { [JsogAttribute()] - internal class TestModelC + internal sealed class TestModelC { public string Name { get; set; } } diff --git a/APIMatic.Core.Test/MockTypes/Models/TestModelForMapOfDateTime.cs b/APIMatic.Core.Test/MockTypes/Models/TestModelForMapOfDateTime.cs index 6ea5d652..62368311 100644 --- a/APIMatic.Core.Test/MockTypes/Models/TestModelForMapOfDateTime.cs +++ b/APIMatic.Core.Test/MockTypes/Models/TestModelForMapOfDateTime.cs @@ -6,7 +6,7 @@ namespace APIMatic.Core.Test.MockTypes.Models { - internal class TestModelForMapOfDateTime + internal sealed class TestModelForMapOfDateTime { [JsonConverter(typeof(CoreMapConverter), typeof(IsoDateTimeConverter))] public Dictionary DateTimePairs { get; set; } diff --git a/APIMatic.Core.Test/MockTypes/Models/TestModelListOfDateTime.cs b/APIMatic.Core.Test/MockTypes/Models/TestModelListOfDateTime.cs index e1cfa370..b4267779 100644 --- a/APIMatic.Core.Test/MockTypes/Models/TestModelListOfDateTime.cs +++ b/APIMatic.Core.Test/MockTypes/Models/TestModelListOfDateTime.cs @@ -6,7 +6,7 @@ namespace APIMatic.Core.Test.MockTypes.Models { - internal class TestModelListOfDateTime + internal sealed class TestModelListOfDateTime { [JsonConverter(typeof(CoreListConverter), typeof(IsoDateTimeConverter))] public List DateTimes { get; set; } diff --git a/APIMatic.Core.Test/MockTypes/Models/UnixDateTimeTestModel.cs b/APIMatic.Core.Test/MockTypes/Models/UnixDateTimeTestModel.cs index be87d1e4..4505b5b6 100644 --- a/APIMatic.Core.Test/MockTypes/Models/UnixDateTimeTestModel.cs +++ b/APIMatic.Core.Test/MockTypes/Models/UnixDateTimeTestModel.cs @@ -4,7 +4,7 @@ namespace APIMatic.Core.Test.MockTypes.Models { - internal class UnixDateTimeTestModel + internal sealed class UnixDateTimeTestModel { [JsonConverter(typeof(UnixDateTimeConverter))] [JsonProperty("dateTime")] diff --git a/APIMatic.Core.Test/MockTypes/Models/UnixDateTimeTestModelFake.cs b/APIMatic.Core.Test/MockTypes/Models/UnixDateTimeTestModelFake.cs index 79433caf..47e3a6e1 100644 --- a/APIMatic.Core.Test/MockTypes/Models/UnixDateTimeTestModelFake.cs +++ b/APIMatic.Core.Test/MockTypes/Models/UnixDateTimeTestModelFake.cs @@ -3,7 +3,7 @@ namespace APIMatic.Core.Test.MockTypes.Models { - internal class UnixDateTimeTestModelFake + internal sealed class UnixDateTimeTestModelFake { [JsonConverter(typeof(UnixDateTimeConverter))] [JsonProperty("dateTime")] diff --git a/APIMatic.Core.Test/MockTypes/Utilities/CompatibilityFactory.cs b/APIMatic.Core.Test/MockTypes/Utilities/CompatibilityFactory.cs index 326db113..fab55316 100644 --- a/APIMatic.Core.Test/MockTypes/Utilities/CompatibilityFactory.cs +++ b/APIMatic.Core.Test/MockTypes/Utilities/CompatibilityFactory.cs @@ -10,7 +10,7 @@ namespace APIMatic.Core.Test.MockTypes.Utilities { - internal class CompatibilityFactory : ICompatibilityFactory + internal sealed class CompatibilityFactory : ICompatibilityFactory { public ApiException CreateApiException(string reason, CoreContext context) => new(reason, CreateHttpContext(context.Request, context.Response)); diff --git a/APIMatic.Core.Test/MockTypes/Utilities/JsonObject.cs b/APIMatic.Core.Test/MockTypes/Utilities/JsonObject.cs index 1197132f..e856c640 100644 --- a/APIMatic.Core.Test/MockTypes/Utilities/JsonObject.cs +++ b/APIMatic.Core.Test/MockTypes/Utilities/JsonObject.cs @@ -35,7 +35,7 @@ internal static JsonObject FromJObject(JObject json) } } - internal class JsonObjectSerializer : JsonConverter + internal sealed class JsonObjectSerializer : JsonConverter { public override JsonObject ReadJson(JsonReader reader, Type objectType, JsonObject existingValue, bool hasExistingValue, JsonSerializer serializer) { diff --git a/APIMatic.Core.Test/MockTypes/Utilities/JsonValue.cs b/APIMatic.Core.Test/MockTypes/Utilities/JsonValue.cs index b8ee8e0d..4170bc24 100644 --- a/APIMatic.Core.Test/MockTypes/Utilities/JsonValue.cs +++ b/APIMatic.Core.Test/MockTypes/Utilities/JsonValue.cs @@ -76,7 +76,7 @@ public static JsonValue FromArray(List values) } } - internal class JsonValueSerializer : JsonConverter + internal sealed class JsonValueSerializer : JsonConverter { public override JsonValue ReadJson(JsonReader reader, Type objectType, JsonValue existingValue, bool hasExistingValue, JsonSerializer serializer) { diff --git a/APIMatic.Core.Test/MockTypes/Utilities/TestLogger.cs b/APIMatic.Core.Test/MockTypes/Utilities/TestLogger.cs index 7294a5cd..78c745d1 100644 --- a/APIMatic.Core.Test/MockTypes/Utilities/TestLogger.cs +++ b/APIMatic.Core.Test/MockTypes/Utilities/TestLogger.cs @@ -4,7 +4,7 @@ namespace APIMatic.Core.Test.MockTypes.Utilities { - internal class TestLogger : ILogger + internal sealed class TestLogger : ILogger { public IList LoggedMessages { get; } = new List(); @@ -25,7 +25,7 @@ public void Log(LogLevel logLevel, EventId eventId, TState state, Except LoggedMessages.Add(new LogEntry(logLevel, message)); } - internal class LogEntry + internal sealed class LogEntry { public LogLevel LogLevel { get; } public string Message { get; } diff --git a/APIMatic.Core.Test/TypesTest.cs b/APIMatic.Core.Test/TypesTest.cs index 5ea4bd51..29cfe91b 100644 --- a/APIMatic.Core.Test/TypesTest.cs +++ b/APIMatic.Core.Test/TypesTest.cs @@ -27,7 +27,7 @@ public void MultipartContent_AdditionalHeaders() var file = new CoreFileStreamInfo(memStream, "test - stream.file"); Dictionary> multipartHeaders = new(StringComparer.OrdinalIgnoreCase) { - { "myHeader", new[] { "personalHeaderValue" } } + { "myHeader", ["personalHeaderValue"] } }; var fileContent = new MultipartFileContent(file, multipartHeaders); var content = fileContent.ToHttpContent("file"); diff --git a/APIMatic.Core.Test/Utilities/AnyOfContainerTest.cs b/APIMatic.Core.Test/Utilities/AnyOfContainerTest.cs index 52097e23..a047ad10 100644 --- a/APIMatic.Core.Test/Utilities/AnyOfContainerTest.cs +++ b/APIMatic.Core.Test/Utilities/AnyOfContainerTest.cs @@ -120,14 +120,14 @@ public void TestNativeCollectionType() container.Match( precisionArray: value => { - double[] expectedPrecision = { 0.987 }; + double[] expectedPrecision = [0.987]; CollectionAssert.AreEqual(expectedPrecision, value); Console.WriteLine(string.Join(", ", value)); return null; }, mStringArray: value => { - string[] expectedStringArray = { "some string array" }; + string[] expectedStringArray = ["some string array"]; CollectionAssert.AreEqual(expectedStringArray, value); Console.WriteLine(string.Join(", ", value)); return null; @@ -136,14 +136,14 @@ public void TestNativeCollectionType() container.Match( precisionArray: value => { - double[] expectedPrecision = { 0.987 }; + double[] expectedPrecision = [ 0.987 ]; CollectionAssert.AreEqual(expectedPrecision, value); Console.WriteLine(string.Join(", ", value)); return null; }, mStringArray: value => { - string[] expectedStringArray = { "some string array" }; + string[] expectedStringArray = ["some string array"]; CollectionAssert.AreEqual(expectedStringArray, value); Console.WriteLine(string.Join(", ", value)); return null; @@ -152,14 +152,14 @@ public void TestNativeCollectionType() container.Match( precisionArray: value => { - double[] expectedPrecision = { 0.987 }; + double[] expectedPrecision = [ 0.987 ]; CollectionAssert.AreEqual(expectedPrecision, value); Console.WriteLine(string.Join(", ", value)); return null; }, mStringArray: value => { - string[] expectedStringArray = { "some string array" }; + string[] expectedStringArray = [ "some string array" ]; CollectionAssert.AreEqual(expectedStringArray, value); Console.WriteLine(string.Join(", ", value)); return null; @@ -168,14 +168,14 @@ public void TestNativeCollectionType() container.Match( precisionArray: value => { - double[] expectedPrecision = { 0.987 }; + double[] expectedPrecision = [ 0.987 ]; CollectionAssert.AreEqual(expectedPrecision, value); Console.WriteLine(string.Join(", ", value)); return null; }, mStringArray: value => { - string[] expectedStringArray = { "some string array" }; + string[] expectedStringArray = [ "some string array" ]; CollectionAssert.AreEqual(expectedStringArray, value); Console.WriteLine(string.Join(", ", value)); return null; diff --git a/APIMatic.Core.Test/Utilities/Date/CoreListDateTimeConverterTest.cs b/APIMatic.Core.Test/Utilities/Date/CoreListDateTimeConverterTest.cs index 04c6462c..139a664b 100644 --- a/APIMatic.Core.Test/Utilities/Date/CoreListDateTimeConverterTest.cs +++ b/APIMatic.Core.Test/Utilities/Date/CoreListDateTimeConverterTest.cs @@ -9,7 +9,7 @@ namespace APIMatic.Core.Test.Utilities.Date { [TestFixture] - internal class CoreListDateTimeConverterTest + internal sealed class CoreListDateTimeConverterTest { [Test] public void SerializeListOfDateTime() diff --git a/APIMatic.Core.Test/Utilities/Date/CoreMapDateTimeConverterTest.cs b/APIMatic.Core.Test/Utilities/Date/CoreMapDateTimeConverterTest.cs index 60484c39..44c4c37d 100644 --- a/APIMatic.Core.Test/Utilities/Date/CoreMapDateTimeConverterTest.cs +++ b/APIMatic.Core.Test/Utilities/Date/CoreMapDateTimeConverterTest.cs @@ -9,7 +9,7 @@ namespace APIMatic.Core.Test.Utilities.Date { [TestFixture] - internal class CoreMapDateTimeConverterTest + internal sealed class CoreMapDateTimeConverterTest { [Test] public void SerializeMapOfDateTime() diff --git a/APIMatic.Core.Test/Utilities/Date/CoreUnixDateTimeConvertorTest.cs b/APIMatic.Core.Test/Utilities/Date/CoreUnixDateTimeConvertorTest.cs index 66e9bb30..6934b7cd 100644 --- a/APIMatic.Core.Test/Utilities/Date/CoreUnixDateTimeConvertorTest.cs +++ b/APIMatic.Core.Test/Utilities/Date/CoreUnixDateTimeConvertorTest.cs @@ -10,7 +10,7 @@ namespace APIMatic.Core.Test.Utilities.Date { [TestFixture] - internal class CoreUnixDateTimeConvertorTest + internal sealed class CoreUnixDateTimeConvertorTest { [Test] public void UnixDateTimeConverter_ReadJson() diff --git a/APIMatic.Core.Test/Utilities/Date/StringReplacer.cs b/APIMatic.Core.Test/Utilities/Date/StringReplacer.cs index 01aa33e6..222d75c6 100644 --- a/APIMatic.Core.Test/Utilities/Date/StringReplacer.cs +++ b/APIMatic.Core.Test/Utilities/Date/StringReplacer.cs @@ -1,6 +1,6 @@ namespace APIMatic.Core.Test.Utilities.Date { - internal class StringReplacer + internal sealed class StringReplacer { internal static string ReplaceBackSlashR(string value) { diff --git a/APIMatic.Core.Test/Utilities/Date/Xml/Rfc1123DateTimeXmlUtilityTest.cs b/APIMatic.Core.Test/Utilities/Date/Xml/Rfc1123DateTimeXmlUtilityTest.cs index d5cefaf8..96341dd8 100644 --- a/APIMatic.Core.Test/Utilities/Date/Xml/Rfc1123DateTimeXmlUtilityTest.cs +++ b/APIMatic.Core.Test/Utilities/Date/Xml/Rfc1123DateTimeXmlUtilityTest.cs @@ -7,7 +7,7 @@ namespace APIMatic.Core.Test.Utilities.Date.Xml { [TestFixture] - internal class Rfc1123DateTimeXmlUtilityTest + internal sealed class Rfc1123DateTimeXmlUtilityTest { [Test] public void StringToRfc1123Date_WithNullString() diff --git a/APIMatic.Core.Test/Utilities/Date/Xml/Rfc3339DateTimeXmlUtilityTest.cs b/APIMatic.Core.Test/Utilities/Date/Xml/Rfc3339DateTimeXmlUtilityTest.cs index 8841766e..c6af1419 100644 --- a/APIMatic.Core.Test/Utilities/Date/Xml/Rfc3339DateTimeXmlUtilityTest.cs +++ b/APIMatic.Core.Test/Utilities/Date/Xml/Rfc3339DateTimeXmlUtilityTest.cs @@ -7,7 +7,7 @@ namespace APIMatic.Core.Test.Utilities.Date.Xml { [TestFixture] - internal class Rfc3339DateTimeXmlUtilityTest + internal sealed class Rfc3339DateTimeXmlUtilityTest { [Test] public void StringToRfc3339Date_WithEmptyString() diff --git a/APIMatic.Core.Test/Utilities/Date/Xml/UnixDateTimeXmlConverterTest.cs b/APIMatic.Core.Test/Utilities/Date/Xml/UnixDateTimeXmlConverterTest.cs index c745d977..159080c8 100644 --- a/APIMatic.Core.Test/Utilities/Date/Xml/UnixDateTimeXmlConverterTest.cs +++ b/APIMatic.Core.Test/Utilities/Date/Xml/UnixDateTimeXmlConverterTest.cs @@ -6,7 +6,7 @@ namespace APIMatic.Core.Test.Utilities.Date.Xml { [TestFixture] - internal class UnixDateTimeXmlConverterTest + internal sealed class UnixDateTimeXmlConverterTest { [Test] public void UnixDateToString_WithDate() diff --git a/APIMatic.Core.Test/Utilities/OneOfContainerTest.cs b/APIMatic.Core.Test/Utilities/OneOfContainerTest.cs index 991b428b..6fc56f9c 100644 --- a/APIMatic.Core.Test/Utilities/OneOfContainerTest.cs +++ b/APIMatic.Core.Test/Utilities/OneOfContainerTest.cs @@ -159,14 +159,14 @@ public void TestNativeCollectionType() container.Match( precision: value => { - double[] expectedPrecision = { 0.987, 0.6987 }; + double[] expectedPrecision = [ 0.987, 0.6987 ]; CollectionAssert.AreEqual(expectedPrecision, value); Console.WriteLine(string.Join(", ", value)); return null; }, mString: value => { - string[] expectedStringArray = { "some string array", "test" }; + string[] expectedStringArray = [ "some string array", "test" ]; CollectionAssert.AreEqual(expectedStringArray, value); Console.WriteLine(string.Join(", ", value)); return null; @@ -185,14 +185,14 @@ public void TestNativeCollectionType() container.Match( precision: value => { - double[] expectedPrecision = { 0.987, 0.6987 }; + double[] expectedPrecision = [ 0.987, 0.6987 ]; CollectionAssert.AreEqual(expectedPrecision, value); Console.WriteLine(string.Join(", ", value)); return null; }, mString: value => { - string[] expectedStringArray = { "some string array", "test" }; + string[] expectedStringArray = [ "some string array", "test" ]; CollectionAssert.AreEqual(expectedStringArray, value); Console.WriteLine(string.Join(", ", value)); return null; @@ -211,14 +211,14 @@ public void TestNativeCollectionType() container.Match( precision: value => { - double[] expectedPrecision = { 0.987, 0.6987 }; + double[] expectedPrecision = [0.987, 0.6987]; CollectionAssert.AreEqual(expectedPrecision, value); Console.WriteLine(string.Join(", ", value)); return null; }, mString: value => { - string[] expectedStringArray = { "some string array", "test" }; + string[] expectedStringArray = ["some string array", "test"]; CollectionAssert.AreEqual(expectedStringArray, value); Console.WriteLine(string.Join(", ", value)); return null; @@ -237,14 +237,14 @@ public void TestNativeCollectionType() container.Match( precision: value => { - double[] expectedPrecision = { 0.987, 0.6987 }; + double[] expectedPrecision = [0.987, 0.6987]; CollectionAssert.AreEqual(expectedPrecision, value); Console.WriteLine(string.Join(", ", value)); return null; }, mString: value => { - string[] expectedStringArray = { "some string array", "test" }; + string[] expectedStringArray = ["some string array", "test"]; CollectionAssert.AreEqual(expectedStringArray, value); Console.WriteLine(string.Join(", ", value)); return null; @@ -264,14 +264,14 @@ public void TestNativeCollectionType() container.Match( precision: value => { - double[] expectedPrecision = { 0.987, 0.6987 }; + double[] expectedPrecision = [0.987, 0.6987]; CollectionAssert.AreEqual(expectedPrecision, value); Console.WriteLine(string.Join(", ", value)); return null; }, mString: value => { - string[] expectedStringArray = { "some string array", "test" }; + string[] expectedStringArray = ["some string array", "test"]; CollectionAssert.AreEqual(expectedStringArray, value); Console.WriteLine(string.Join(", ", value)); return null; @@ -290,14 +290,14 @@ public void TestNativeCollectionType() container.Match( precision: value => { - double[] expectedPrecision = { 0.987, 0.6987 }; + double[] expectedPrecision = [0.987, 0.6987]; CollectionAssert.AreEqual(expectedPrecision, value); Console.WriteLine(string.Join(", ", value)); return null; }, mString: value => { - string[] expectedStringArray = { "some string array", "test" }; + string[] expectedStringArray = ["some string array", "test"]; CollectionAssert.AreEqual(expectedStringArray, value); Console.WriteLine(string.Join(", ", value)); return null; @@ -572,7 +572,7 @@ public void TestCustomTypeCollection() atom: value => { Atom expectedAtom = new Atom(12, 13); - Atom[] expected = { expectedAtom }; + Atom[] expected = [expectedAtom]; Assert.AreEqual(expected, value); Console.WriteLine(value); return null; @@ -580,7 +580,7 @@ public void TestCustomTypeCollection() orbit: value => { Orbit expectedOrbit = new Orbit(12, "3"); - Orbit[] expected = { expectedOrbit }; + Orbit[] expected = [expectedOrbit]; Assert.AreEqual(expected, value); Console.WriteLine(value); return null; @@ -590,7 +590,7 @@ public void TestCustomTypeCollection() atom: value => { Atom expectedAtom = new Atom(12, 13); - Atom[] expected = { expectedAtom }; + Atom[] expected = [expectedAtom]; Assert.AreEqual(expected, value); Console.WriteLine(value); return null; @@ -598,7 +598,7 @@ public void TestCustomTypeCollection() orbit: value => { Orbit expectedOrbit = new Orbit(12, "3"); - Orbit[] expected = { expectedOrbit }; + Orbit[] expected = [expectedOrbit]; Assert.AreEqual(expected, value); Console.WriteLine(value); return null; @@ -608,7 +608,7 @@ public void TestCustomTypeCollection() atom: value => { Atom expectedAtom = new Atom(12, 13); - Atom[] expected = { expectedAtom }; + Atom[] expected = [expectedAtom]; Assert.AreEqual(expected, value); Console.WriteLine(value); return null; @@ -616,7 +616,7 @@ public void TestCustomTypeCollection() orbit: value => { Orbit expectedOrbit = new Orbit(12, "3"); - Orbit[] expected = { expectedOrbit }; + Orbit[] expected = [expectedOrbit]; Assert.AreEqual(expected, value); Console.WriteLine(value); return null; @@ -626,7 +626,7 @@ public void TestCustomTypeCollection() atom: value => { Atom expectedAtom = new Atom(12, 13); - Atom[] expected = { expectedAtom }; + Atom[] expected = [expectedAtom]; Assert.AreEqual(expected, value); Console.WriteLine(value); return null; @@ -634,7 +634,7 @@ public void TestCustomTypeCollection() orbit: value => { Orbit expectedOrbit = new Orbit(12, "3"); - Orbit[] expected = { expectedOrbit }; + Orbit[] expected = [expectedOrbit]; Assert.AreEqual(expected, value); Console.WriteLine(value); return null; diff --git a/APIMatic.Core.Test/Utilities/TestHelperTest.cs b/APIMatic.Core.Test/Utilities/TestHelperTest.cs index 8fcd3cc1..19b90c31 100644 --- a/APIMatic.Core.Test/Utilities/TestHelperTest.cs +++ b/APIMatic.Core.Test/Utilities/TestHelperTest.cs @@ -7,7 +7,7 @@ namespace APIMatic.Core.Test.Utilities { [TestFixture] - internal class TestHelperTest + internal sealed class TestHelperTest { private const string OBJECT_STRING = "[{\"name\":\"Shahid Khaliq\",\"age\":5147483645,\"address\":\"H # 531, S # 20\",\"uid\":\"123321\",\"birthday\":\"1994-02-13\",\"birthtime\":\"1994-02-13T14:01:54.9571247Z\",\"salary\":20000,\"department\":\"Software Development\",\"joiningDay\":\"Saturday\",\"workingDays\":[\"Monday\",\"Tuesday\",\"Friday\"],\"boss\":{\"personType\":\"Boss\",\"name\":\"Zeeshan Ejaz\",\"age\":5147483645,\"address\":\"H # 531, S # 20\",\"uid\":\"123321\",\"birthday\":\"1994-02-13\",\"birthtime\":\"1994-02-13T14:01:54.9571247Z\",\"salary\":20000,\"department\":\"Software Development\",\"joiningDay\":\"Saturday\",\"workingDays\":[\"Monday\",\"Tuesday\",\"Friday\"],\"dependents\":[{\"name\":\"Future Wife\",\"age\":5147483649,\"address\":\"H # 531, S # 20\",\"uid\":\"123412\",\"birthday\":\"1994-02-13\",\"birthtime\":\"1994-02-13T14:01:54.9571247Z\"},{\"name\":\"Future Kid\",\"age\":5147483648,\"address\":\"H # 531, S # 20\",\"uid\":\"312341\",\"birthday\":\"1994-02-13\",\"birthtime\":\"1994-02-13T14:01:54.9571247Z\"}],\"hiredAt\":\"Sun, 06 Nov 1994 08:49:37 GMT\",\"promotedAt\":1484719381},\"dependents\":[{\"name\":\"Future Wife\",\"age\":5147483649,\"address\":\"H # 531, S # 20\",\"uid\":\"123412\",\"birthday\":\"1994-02-13\",\"birthtime\":\"1994-02-13T14:01:54.9571247Z\"},{\"name\":\"Future Kid\",\"age\":5147483648,\"address\":\"H # 531, S # 20\",\"uid\":\"312341\",\"birthday\":\"1994-02-13\",\"birthtime\":\"1994-02-13T14:01:54.9571247Z\"}],\"hiredAt\":\"Sun, 06 Nov 1994 08:49:37 GMT\"},{\"name\":\"Shahid Khaliq\",\"age\":5147483645,\"address\":\"H # 531, S # 20\",\"uid\":\"123321\",\"birthday\":\"1994-02-13\",\"birthtime\":\"1994-02-13T14:01:54.9571247Z\",\"salary\":20000,\"department\":\"Software Development\",\"joiningDay\":\"Saturday\",\"workingDays\":[\"Monday\",\"Tuesday\",\"Friday\"],\"boss\":{\"personType\":\"Boss\",\"name\":\"Zeeshan Ejaz\",\"age\":5147483645,\"address\":\"H # 531, S # 20\",\"uid\":\"123321\",\"birthday\":\"1994-02-13\",\"birthtime\":\"1994-02-13T14:01:54.9571247Z\",\"salary\":20000,\"department\":\"Software Development\",\"joiningDay\":\"Saturday\",\"workingDays\":[\"Monday\",\"Tuesday\",\"Friday\"],\"dependents\":[{\"name\":\"Future Wife\",\"age\":5147483649,\"address\":\"H # 531, S # 20\",\"uid\":\"123412\",\"birthday\":\"1994-02-13\",\"birthtime\":\"1994-02-13T14:01:54.9571247Z\"},{\"name\":\"Future Kid\",\"age\":5147483648,\"address\":\"H # 531, S # 20\",\"uid\":\"312341\",\"birthday\":\"1994-02-13\",\"birthtime\":\"1994-02-13T14:01:54.9571247Z\"}],\"hiredAt\":\"Sun, 06 Nov 1994 08:49:37 GMT\",\"promotedAt\":1484719381},\"dependents\":[{\"name\":\"Future Wife\",\"age\":5147483649,\"address\":\"H # 531, S # 20\",\"uid\":\"123412\",\"birthday\":\"1994-02-13\",\"birthtime\":\"1994-02-13T14:01:54.9571247Z\"},{\"name\":\"Future Kid\",\"age\":5147483648,\"address\":\"H # 531, S # 20\",\"uid\":\"312341\",\"birthday\":\"1994-02-13\",\"birthtime\":\"1994-02-13T14:01:54.9571247Z\"}],\"hiredAt\":\"Sun, 06 Nov 1994 08:49:37 GMT\"}]"; diff --git a/APIMatic.Core.Test/Utilities/XmlUtilityTest.cs b/APIMatic.Core.Test/Utilities/XmlUtilityTest.cs index d3fe72d1..ee1c69ee 100644 --- a/APIMatic.Core.Test/Utilities/XmlUtilityTest.cs +++ b/APIMatic.Core.Test/Utilities/XmlUtilityTest.cs @@ -7,7 +7,7 @@ namespace APIMatic.Core.Test.Utilities { [TestFixture] - internal class XmlUtilityTest + internal sealed class XmlUtilityTest { [Test] public void ToXml_NullObject() @@ -21,13 +21,10 @@ public void ToXml_NullObject() [Test] public void ModelsArrayToXml_WithoutArrayName() { - List testModels = new List() - { - new TestModel() - { - Integers = new int[] { 1, 2, 3 } - } - }; + List testModels = + [ + new TestModel() { Integers = [1, 2, 3] } + ]; string expected = "\n \n 0001-01-01T00:00:00\n \n 1\n 2\n 3\n \n \n"; string actual = StringReplacer.ReplaceBackSlashR(XmlUtility.ModelsArrayToXml(testModels)); @@ -37,13 +34,10 @@ public void ModelsArrayToXml_WithoutArrayName() [Test] public void ModelsArrayToXml_WithArrayItemName() { - List testModels = new List() - { - new TestModel() - { - Integers = new int[] { 1, 2, 3 } - } - }; + List testModels = + [ + new TestModel() { Integers = [1, 2, 3] } + ]; string expected = "\n 0001-01-01T00:00:00\n \n 1\n 2\n 3\n \n"; string actual = StringReplacer.ReplaceBackSlashR(XmlUtility.ModelsArrayToXml(testModels, arrayItemName: "TestModel")); @@ -62,13 +56,10 @@ public void ModelsArrayToXml_NullList() [Test] public void ModelsArrayToXml_WithArrayName() { - List testModels = new List() - { - new TestModel() - { - Integers = new int[] { 1, 2, 3 } - } - }; + List testModels = + [ + new TestModel() { Integers = [1, 2, 3] } + ]; string expected = "\n \n 0001-01-01T00:00:00\n \n 1\n 2\n 3\n \n \n"; string actual = StringReplacer.ReplaceBackSlashR(XmlUtility.ModelsArrayToXml(testModels, arrayName: "abd", arrayItemName: "xyz")); @@ -78,10 +69,7 @@ public void ModelsArrayToXml_WithArrayName() [Test] public void NativeTypesArrayFromXml_WithArrayName() { - List expected = new List() - { - "alpha", "beta", "gamma" - }; + List expected = ["alpha", "beta", "gamma"]; string nativeObjectString = "\r\n alpha\r\n beta\r\n gamma\r\n"; List actual = XmlUtility.NativeTypesArrayFromXml(nativeObjectString); @@ -99,10 +87,7 @@ public void NativeTypesArrayFromXml_NullString() [Test] public void NativeTypesArrayToXml_WithArrayName() { - List testModels = new List() - { - "alpha", "beta", "gamma" - }; + List testModels = ["alpha", "beta", "gamma"]; string expected = "\n alpha\n beta\n gamma\n"; string actual = XmlUtility.NativeTypesArrayToXml(testModels, arrayName: "root"); @@ -112,10 +97,7 @@ public void NativeTypesArrayToXml_WithArrayName() [Test] public void NativeTypesArrayToXml_WithoutArrayName() { - List testModels = new List() - { - "alpha", "beta", "gamma" - }; + List testModels = ["alpha", "beta", "gamma"]; string expected = "\n alpha\n beta\n gamma\n"; string actual = StringReplacer.ReplaceBackSlashR(XmlUtility.NativeTypesArrayToXml(testModels)); @@ -142,10 +124,7 @@ public void FromXml_EmptyString() [Test] public void FromXml_ValidInput() { - List expected = new List() - { - "alpha", "beta", "gamma" - }; + List expected = ["alpha", "beta", "gamma"]; string local = XmlUtility.ToXml(expected, rootName: "root"); var actual = XmlUtility.FromXml>(local, rootName: "root");