< Summary

Information
Class: /home/wethinkcode/student_work/csharp/GroupProject/super-cool-group/weshare-qa/GeneratedApiCode/src/Applications.WeShare.Swagger/Model/ExpenseDTO.cs
Assembly: Default
File(s): /home/wethinkcode/student_work/csharp/GroupProject/super-cool-group/weshare-qa/GeneratedApiCode/src/Applications.WeShare.Swagger/Model/ExpenseDTO.cs
Line coverage
8%
Covered lines: 9
Uncovered lines: 92
Coverable lines: 101
Total lines: 235
Line coverage: 8.9%
Branch coverage
0%
Covered branches: 0
Total branches: 40
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

File(s)

/home/wethinkcode/student_work/csharp/GroupProject/super-cool-group/weshare-qa/GeneratedApiCode/src/Applications.WeShare.Swagger/Model/ExpenseDTO.cs

#LineLine coverage
 1/*
 2 * WeShare API
 3 *
 4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 5 *
 6 * The version of the OpenAPI document: 1.0
 7 * Generated by: https://github.com/openapitools/openapi-generator.git
 8 */
 9
 10
 11using System;
 12using System.Collections;
 13using System.Collections.Generic;
 14using System.Collections.ObjectModel;
 15using System.Linq;
 16using System.IO;
 17using System.Runtime.Serialization;
 18using System.Text;
 19using System.Text.RegularExpressions;
 20using Newtonsoft.Json;
 21using Newtonsoft.Json.Converters;
 22using Newtonsoft.Json.Linq;
 23using System.ComponentModel.DataAnnotations;
 24using OpenAPIDateConverter = Applications.WeShare.Swagger.Client.OpenAPIDateConverter;
 25
 26namespace Applications.WeShare.Swagger.Model
 27{
 28    /// <summary>
 29    /// ExpenseDTO
 30    /// </summary>
 31    [DataContract(Name = "ExpenseDTO")]
 32    public partial class ExpenseDTO : IEquatable<ExpenseDTO>, IValidatableObject
 33    {
 34        /// <summary>
 35        /// Initializes a new instance of the <see cref="ExpenseDTO" /> class.
 36        /// </summary>
 37        [JsonConstructorAttribute]
 4238        protected ExpenseDTO() { }
 39        /// <summary>
 40        /// Initializes a new instance of the <see cref="ExpenseDTO" /> class.
 41        /// </summary>
 42        /// <param name="expenseId">expenseId.</param>
 43        /// <param name="personId">personId.</param>
 44        /// <param name="date">date.</param>
 45        /// <param name="description">description.</param>
 46        /// <param name="amount">amount (required).</param>
 47        /// <param name="totalPaymentsRequested">totalPaymentsRequested (required).</param>
 48        /// <param name="totalPaymentsReceived">totalPaymentsReceived (required).</param>
 49        /// <param name="nettAmount">nettAmount (required).</param>
 050        public ExpenseDTO(int expenseId = default(int), int personId = default(int), string date = default(string), stri
 051        {
 052            this.Amount = amount;
 053            this.TotalPaymentsRequested = totalPaymentsRequested;
 054            this.TotalPaymentsReceived = totalPaymentsReceived;
 055            this.NettAmount = nettAmount;
 056            this.ExpenseId = expenseId;
 057            this.PersonId = personId;
 058            this.Date = date;
 059            this.Description = description;
 060        }
 61
 62        /// <summary>
 63        /// Gets or Sets ExpenseId
 64        /// </summary>
 65        [DataMember(Name = "expenseId", EmitDefaultValue = false)]
 1666        public int ExpenseId { get; set; }
 67
 68        /// <summary>
 69        /// Gets or Sets PersonId
 70        /// </summary>
 71        [DataMember(Name = "personId", EmitDefaultValue = false)]
 1772        public int PersonId { get; set; }
 73
 74        /// <summary>
 75        /// Gets or Sets Date
 76        /// </summary>
 77        [DataMember(Name = "date", EmitDefaultValue = false)]
 1778        public string Date { get; set; }
 79
 80        /// <summary>
 81        /// Gets or Sets Description
 82        /// </summary>
 83        [DataMember(Name = "description", EmitDefaultValue = false)]
 1784        public string Description { get; set; }
 85
 86        /// <summary>
 87        /// Gets or Sets Amount
 88        /// </summary>
 89        [DataMember(Name = "amount", IsRequired = true, EmitDefaultValue = true)]
 1790        public long Amount { get; set; }
 91
 92        /// <summary>
 93        /// Gets or Sets TotalPaymentsRequested
 94        /// </summary>
 95        [DataMember(Name = "totalPaymentsRequested", IsRequired = true, EmitDefaultValue = true)]
 1696        public long TotalPaymentsRequested { get; set; }
 97
 98        /// <summary>
 99        /// Gets or Sets TotalPaymentsReceived
 100        /// </summary>
 101        [DataMember(Name = "totalPaymentsReceived", IsRequired = true, EmitDefaultValue = true)]
 16102        public long TotalPaymentsReceived { get; set; }
 103
 104        /// <summary>
 105        /// Gets or Sets NettAmount
 106        /// </summary>
 107        [DataMember(Name = "nettAmount", IsRequired = true, EmitDefaultValue = true)]
 16108        public long NettAmount { get; set; }
 109
 110        /// <summary>
 111        /// Returns the string presentation of the object
 112        /// </summary>
 113        /// <returns>String presentation of the object</returns>
 114        public override string ToString()
 0115        {
 0116            StringBuilder sb = new StringBuilder();
 0117            sb.Append("class ExpenseDTO {\n");
 0118            sb.Append("  ExpenseId: ").Append(ExpenseId).Append("\n");
 0119            sb.Append("  PersonId: ").Append(PersonId).Append("\n");
 0120            sb.Append("  Date: ").Append(Date).Append("\n");
 0121            sb.Append("  Description: ").Append(Description).Append("\n");
 0122            sb.Append("  Amount: ").Append(Amount).Append("\n");
 0123            sb.Append("  TotalPaymentsRequested: ").Append(TotalPaymentsRequested).Append("\n");
 0124            sb.Append("  TotalPaymentsReceived: ").Append(TotalPaymentsReceived).Append("\n");
 0125            sb.Append("  NettAmount: ").Append(NettAmount).Append("\n");
 0126            sb.Append("}\n");
 0127            return sb.ToString();
 0128        }
 129
 130        /// <summary>
 131        /// Returns the JSON string presentation of the object
 132        /// </summary>
 133        /// <returns>JSON string presentation of the object</returns>
 134        public virtual string ToJson()
 0135        {
 0136            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
 0137        }
 138
 139        /// <summary>
 140        /// Returns true if objects are equal
 141        /// </summary>
 142        /// <param name="input">Object to be compared</param>
 143        /// <returns>Boolean</returns>
 144        public override bool Equals(object input)
 0145        {
 0146            return this.Equals(input as ExpenseDTO);
 0147        }
 148
 149        /// <summary>
 150        /// Returns true if ExpenseDTO instances are equal
 151        /// </summary>
 152        /// <param name="input">Instance of ExpenseDTO to be compared</param>
 153        /// <returns>Boolean</returns>
 154        public bool Equals(ExpenseDTO input)
 0155        {
 0156            if (input == null)
 0157            {
 0158                return false;
 159            }
 0160            return
 0161                (
 0162                    this.ExpenseId == input.ExpenseId ||
 0163                    this.ExpenseId.Equals(input.ExpenseId)
 0164                ) &&
 0165                (
 0166                    this.PersonId == input.PersonId ||
 0167                    this.PersonId.Equals(input.PersonId)
 0168                ) &&
 0169                (
 0170                    this.Date == input.Date ||
 0171                    (this.Date != null &&
 0172                    this.Date.Equals(input.Date))
 0173                ) &&
 0174                (
 0175                    this.Description == input.Description ||
 0176                    (this.Description != null &&
 0177                    this.Description.Equals(input.Description))
 0178                ) &&
 0179                (
 0180                    this.Amount == input.Amount ||
 0181                    this.Amount.Equals(input.Amount)
 0182                ) &&
 0183                (
 0184                    this.TotalPaymentsRequested == input.TotalPaymentsRequested ||
 0185                    this.TotalPaymentsRequested.Equals(input.TotalPaymentsRequested)
 0186                ) &&
 0187                (
 0188                    this.TotalPaymentsReceived == input.TotalPaymentsReceived ||
 0189                    this.TotalPaymentsReceived.Equals(input.TotalPaymentsReceived)
 0190                ) &&
 0191                (
 0192                    this.NettAmount == input.NettAmount ||
 0193                    this.NettAmount.Equals(input.NettAmount)
 0194                );
 0195        }
 196
 197        /// <summary>
 198        /// Gets the hash code
 199        /// </summary>
 200        /// <returns>Hash code</returns>
 201        public override int GetHashCode()
 0202        {
 203            unchecked // Overflow is fine, just wrap
 0204            {
 0205                int hashCode = 41;
 0206                hashCode = (hashCode * 59) + this.ExpenseId.GetHashCode();
 0207                hashCode = (hashCode * 59) + this.PersonId.GetHashCode();
 0208                if (this.Date != null)
 0209                {
 0210                    hashCode = (hashCode * 59) + this.Date.GetHashCode();
 0211                }
 0212                if (this.Description != null)
 0213                {
 0214                    hashCode = (hashCode * 59) + this.Description.GetHashCode();
 0215                }
 0216                hashCode = (hashCode * 59) + this.Amount.GetHashCode();
 0217                hashCode = (hashCode * 59) + this.TotalPaymentsRequested.GetHashCode();
 0218                hashCode = (hashCode * 59) + this.TotalPaymentsReceived.GetHashCode();
 0219                hashCode = (hashCode * 59) + this.NettAmount.GetHashCode();
 0220                return hashCode;
 221            }
 0222        }
 223
 224        /// <summary>
 225        /// To validate all properties of the instance
 226        /// </summary>
 227        /// <param name="validationContext">Validation context</param>
 228        /// <returns>Validation Result</returns>
 229        public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validation
 0230        {
 0231            yield break;
 232        }
 233    }
 234
 235}