From f8c20c22e1738f284fbaf30c84dc9f806c2ec51c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 22 Sep 2020 07:42:41 +0800 Subject: [PATCH] remove old csharp files under integration tests folder (#7466) --- ...yClassWithInvalidRequiredEnumUsageOnRef.cs | 140 ----------- .../Model/MyClassWithOptionalEnum.cs | 156 ------------- .../Model/MyClassWithOptionalInlineEnum.cs | 206 ---------------- .../Model/MyClassWithRequiredInlineEnum.cs | 219 ------------------ .../src/IO.Swagger/Model/WeekDays.cs | 79 ------- 5 files changed, 800 deletions(-) delete mode 100644 modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithInvalidRequiredEnumUsageOnRef.cs delete mode 100644 modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithOptionalEnum.cs delete mode 100644 modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithOptionalInlineEnum.cs delete mode 100644 modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithRequiredInlineEnum.cs delete mode 100644 modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/WeekDays.cs diff --git a/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithInvalidRequiredEnumUsageOnRef.cs b/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithInvalidRequiredEnumUsageOnRef.cs deleted file mode 100644 index 9ef77f4b5a3..00000000000 --- a/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithInvalidRequiredEnumUsageOnRef.cs +++ /dev/null @@ -1,140 +0,0 @@ -/* - * My title - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * OpenAPI spec version: 1 - * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = IO.Swagger.Client.OpenAPIDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// Invalid use of required on $ref enum, per Swagger 2.0 spec: Any members other than '$ref' in a JSON Reference object SHALL be ignored. See My_Class_With_Required_Inline_Enum for appropriate usage. - /// - [DataContract] - public partial class MyClassWithInvalidRequiredEnumUsageOnRef : IEquatable, IValidatableObject - { - /// - /// Gets or Sets Days - /// - [DataMember(Name="days", EmitDefaultValue=false)] - public WeekDays? Days { get; set; } - /// - /// Initializes a new instance of the class. - /// - /// first. - /// days. - public MyClassWithInvalidRequiredEnumUsageOnRef(bool? first = default(bool?), WeekDays? days = default(WeekDays?)) - { - this.First = first; - this.Days = days; - } - - /// - /// Gets or Sets First - /// - [DataMember(Name="first", EmitDefaultValue=false)] - public bool? First { get; set; } - - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class MyClassWithInvalidRequiredEnumUsageOnRef {\n"); - sb.Append(" First: ").Append(First).Append("\n"); - sb.Append(" Days: ").Append(Days).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as MyClassWithInvalidRequiredEnumUsageOnRef); - } - - /// - /// Returns true if MyClassWithInvalidRequiredEnumUsageOnRef instances are equal - /// - /// Instance of MyClassWithInvalidRequiredEnumUsageOnRef to be compared - /// Boolean - public bool Equals(MyClassWithInvalidRequiredEnumUsageOnRef input) - { - if (input == null) - return false; - - return - ( - this.First == input.First || - (this.First != null && - this.First.Equals(input.First)) - ) && - ( - this.Days == input.Days || - (this.Days != null && - this.Days.Equals(input.Days)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.First != null) - hashCode = hashCode * 59 + this.First.GetHashCode(); - if (this.Days != null) - hashCode = hashCode * 59 + this.Days.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithOptionalEnum.cs b/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithOptionalEnum.cs deleted file mode 100644 index f88fa64e6a2..00000000000 --- a/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithOptionalEnum.cs +++ /dev/null @@ -1,156 +0,0 @@ -/* - * My title - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * OpenAPI spec version: 1 - * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = IO.Swagger.Client.OpenAPIDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// MyClassWithOptionalEnum - /// - [DataContract] - public partial class MyClassWithOptionalEnum : IEquatable, IValidatableObject - { - /// - /// Gets or Sets Days - /// - [DataMember(Name="days", EmitDefaultValue=false)] - public WeekDays? Days { get; set; } - /// - /// Initializes a new instance of the class. - /// - /// quarantine. - /// grayware. - /// days. - public MyClassWithOptionalEnum(bool? quarantine = default(bool?), bool? grayware = default(bool?), WeekDays? days = default(WeekDays?)) - { - this.Quarantine = quarantine; - this.Grayware = grayware; - this.Days = days; - } - - /// - /// Gets or Sets Quarantine - /// - [DataMember(Name="quarantine", EmitDefaultValue=false)] - public bool? Quarantine { get; set; } - - /// - /// Gets or Sets Grayware - /// - [DataMember(Name="grayware", EmitDefaultValue=false)] - public bool? Grayware { get; set; } - - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class MyClassWithOptionalEnum {\n"); - sb.Append(" Quarantine: ").Append(Quarantine).Append("\n"); - sb.Append(" Grayware: ").Append(Grayware).Append("\n"); - sb.Append(" Days: ").Append(Days).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as MyClassWithOptionalEnum); - } - - /// - /// Returns true if MyClassWithOptionalEnum instances are equal - /// - /// Instance of MyClassWithOptionalEnum to be compared - /// Boolean - public bool Equals(MyClassWithOptionalEnum input) - { - if (input == null) - return false; - - return - ( - this.Quarantine == input.Quarantine || - (this.Quarantine != null && - this.Quarantine.Equals(input.Quarantine)) - ) && - ( - this.Grayware == input.Grayware || - (this.Grayware != null && - this.Grayware.Equals(input.Grayware)) - ) && - ( - this.Days == input.Days || - (this.Days != null && - this.Days.Equals(input.Days)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Quarantine != null) - hashCode = hashCode * 59 + this.Quarantine.GetHashCode(); - if (this.Grayware != null) - hashCode = hashCode * 59 + this.Grayware.GetHashCode(); - if (this.Days != null) - hashCode = hashCode * 59 + this.Days.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithOptionalInlineEnum.cs b/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithOptionalInlineEnum.cs deleted file mode 100644 index 420e12c6e46..00000000000 --- a/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithOptionalInlineEnum.cs +++ /dev/null @@ -1,206 +0,0 @@ -/* - * My title - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * OpenAPI spec version: 1 - * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = IO.Swagger.Client.OpenAPIDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// MyClassWithOptionalInlineEnum - /// - [DataContract] - public partial class MyClassWithOptionalInlineEnum : IEquatable, IValidatableObject - { - /// - /// Defines Days - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum DaysEnum - { - - /// - /// Enum Sun for value: sun - /// - [EnumMember(Value = "sun")] - Sun = 1, - - /// - /// Enum Mon for value: mon - /// - [EnumMember(Value = "mon")] - Mon = 2, - - /// - /// Enum Tue for value: tue - /// - [EnumMember(Value = "tue")] - Tue = 3, - - /// - /// Enum Wed for value: wed - /// - [EnumMember(Value = "wed")] - Wed = 4, - - /// - /// Enum Thu for value: thu - /// - [EnumMember(Value = "thu")] - Thu = 5, - - /// - /// Enum Fri for value: fri - /// - [EnumMember(Value = "fri")] - Fri = 6, - - /// - /// Enum Sat for value: sat - /// - [EnumMember(Value = "sat")] - Sat = 7 - } - - /// - /// Gets or Sets Days - /// - [DataMember(Name="days", EmitDefaultValue=false)] - public DaysEnum? Days { get; set; } - /// - /// Initializes a new instance of the class. - /// - /// quarantine. - /// grayware. - /// days. - public MyClassWithOptionalInlineEnum(bool? quarantine = default(bool?), bool? grayware = default(bool?), DaysEnum? days = default(DaysEnum?)) - { - this.Quarantine = quarantine; - this.Grayware = grayware; - this.Days = days; - } - - /// - /// Gets or Sets Quarantine - /// - [DataMember(Name="quarantine", EmitDefaultValue=false)] - public bool? Quarantine { get; set; } - - /// - /// Gets or Sets Grayware - /// - [DataMember(Name="grayware", EmitDefaultValue=false)] - public bool? Grayware { get; set; } - - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class MyClassWithOptionalInlineEnum {\n"); - sb.Append(" Quarantine: ").Append(Quarantine).Append("\n"); - sb.Append(" Grayware: ").Append(Grayware).Append("\n"); - sb.Append(" Days: ").Append(Days).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as MyClassWithOptionalInlineEnum); - } - - /// - /// Returns true if MyClassWithOptionalInlineEnum instances are equal - /// - /// Instance of MyClassWithOptionalInlineEnum to be compared - /// Boolean - public bool Equals(MyClassWithOptionalInlineEnum input) - { - if (input == null) - return false; - - return - ( - this.Quarantine == input.Quarantine || - (this.Quarantine != null && - this.Quarantine.Equals(input.Quarantine)) - ) && - ( - this.Grayware == input.Grayware || - (this.Grayware != null && - this.Grayware.Equals(input.Grayware)) - ) && - ( - this.Days == input.Days || - (this.Days != null && - this.Days.Equals(input.Days)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Quarantine != null) - hashCode = hashCode * 59 + this.Quarantine.GetHashCode(); - if (this.Grayware != null) - hashCode = hashCode * 59 + this.Grayware.GetHashCode(); - if (this.Days != null) - hashCode = hashCode * 59 + this.Days.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithRequiredInlineEnum.cs b/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithRequiredInlineEnum.cs deleted file mode 100644 index 5c66522e416..00000000000 --- a/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/MyClassWithRequiredInlineEnum.cs +++ /dev/null @@ -1,219 +0,0 @@ -/* - * My title - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * OpenAPI spec version: 1 - * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = IO.Swagger.Client.OpenAPIDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// MyClassWithRequiredInlineEnum - /// - [DataContract] - public partial class MyClassWithRequiredInlineEnum : IEquatable, IValidatableObject - { - /// - /// Defines Days - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum DaysEnum - { - - /// - /// Enum Sun for value: sun - /// - [EnumMember(Value = "sun")] - Sun = 1, - - /// - /// Enum Mon for value: mon - /// - [EnumMember(Value = "mon")] - Mon = 2, - - /// - /// Enum Tue for value: tue - /// - [EnumMember(Value = "tue")] - Tue = 3, - - /// - /// Enum Wed for value: wed - /// - [EnumMember(Value = "wed")] - Wed = 4, - - /// - /// Enum Thu for value: thu - /// - [EnumMember(Value = "thu")] - Thu = 5, - - /// - /// Enum Fri for value: fri - /// - [EnumMember(Value = "fri")] - Fri = 6, - - /// - /// Enum Sat for value: sat - /// - [EnumMember(Value = "sat")] - Sat = 7 - } - - /// - /// Gets or Sets Days - /// - [DataMember(Name="days", EmitDefaultValue=false)] - public DaysEnum Days { get; set; } - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected MyClassWithRequiredInlineEnum() { } - /// - /// Initializes a new instance of the class. - /// - /// quarantine. - /// grayware. - /// days (required). - public MyClassWithRequiredInlineEnum(bool? quarantine = default(bool?), bool? grayware = default(bool?), DaysEnum days = default(DaysEnum)) - { - // to ensure "days" is required (not null) - if (days == null) - { - throw new InvalidDataException("days is a required property for MyClassWithRequiredInlineEnum and cannot be null"); - } - else - { - this.Days = days; - } - this.Quarantine = quarantine; - this.Grayware = grayware; - } - - /// - /// Gets or Sets Quarantine - /// - [DataMember(Name="quarantine", EmitDefaultValue=false)] - public bool? Quarantine { get; set; } - - /// - /// Gets or Sets Grayware - /// - [DataMember(Name="grayware", EmitDefaultValue=false)] - public bool? Grayware { get; set; } - - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class MyClassWithRequiredInlineEnum {\n"); - sb.Append(" Quarantine: ").Append(Quarantine).Append("\n"); - sb.Append(" Grayware: ").Append(Grayware).Append("\n"); - sb.Append(" Days: ").Append(Days).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as MyClassWithRequiredInlineEnum); - } - - /// - /// Returns true if MyClassWithRequiredInlineEnum instances are equal - /// - /// Instance of MyClassWithRequiredInlineEnum to be compared - /// Boolean - public bool Equals(MyClassWithRequiredInlineEnum input) - { - if (input == null) - return false; - - return - ( - this.Quarantine == input.Quarantine || - (this.Quarantine != null && - this.Quarantine.Equals(input.Quarantine)) - ) && - ( - this.Grayware == input.Grayware || - (this.Grayware != null && - this.Grayware.Equals(input.Grayware)) - ) && - ( - this.Days == input.Days || - (this.Days != null && - this.Days.Equals(input.Days)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Quarantine != null) - hashCode = hashCode * 59 + this.Quarantine.GetHashCode(); - if (this.Grayware != null) - hashCode = hashCode * 59 + this.Grayware.GetHashCode(); - if (this.Days != null) - hashCode = hashCode * 59 + this.Days.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/WeekDays.cs b/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/WeekDays.cs deleted file mode 100644 index 67924e50af4..00000000000 --- a/modules/openapi-generator/src/test/resources/integrationtests/csharp/general/enum-support-expected/src/IO.Swagger/Model/WeekDays.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * My title - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * OpenAPI spec version: 1 - * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = IO.Swagger.Client.OpenAPIDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// Defines WeekDays - /// - - [JsonConverter(typeof(StringEnumConverter))] - - public enum WeekDays - { - - /// - /// Enum Sun for value: sun - /// - [EnumMember(Value = "sun")] - Sun = 1, - - /// - /// Enum Mon for value: mon - /// - [EnumMember(Value = "mon")] - Mon = 2, - - /// - /// Enum Tue for value: tue - /// - [EnumMember(Value = "tue")] - Tue = 3, - - /// - /// Enum Wed for value: wed - /// - [EnumMember(Value = "wed")] - Wed = 4, - - /// - /// Enum Thu for value: thu - /// - [EnumMember(Value = "thu")] - Thu = 5, - - /// - /// Enum Fri for value: fri - /// - [EnumMember(Value = "fri")] - Fri = 6, - - /// - /// Enum Sat for value: sat - /// - [EnumMember(Value = "sat")] - Sat = 7 - } - -}