< Summary

Information
Class: /home/wethinkcode/student_work/csharp/GroupProject/super-cool-group/weshare-qa/GeneratedApiCode/src/Applications.WeShare.Swagger/Model/NewExpenseDTO.cs
Assembly: Default
File(s): /home/wethinkcode/student_work/csharp/GroupProject/super-cool-group/weshare-qa/GeneratedApiCode/src/Applications.WeShare.Swagger/Model/NewExpenseDTO.cs
Line coverage
15%
Covered lines: 11
Uncovered lines: 58
Coverable lines: 69
Total lines: 179
Line coverage: 15.9%
Branch coverage
0%
Covered branches: 0
Total branches: 24
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/NewExpenseDTO.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    /// NewExpenseDTO
 30    /// </summary>
 31    [DataContract(Name = "NewExpenseDTO")]
 32    public partial class NewExpenseDTO : IEquatable<NewExpenseDTO>, IValidatableObject
 33    {
 34        /// <summary>
 35        /// Initializes a new instance of the <see cref="NewExpenseDTO" /> class.
 36        /// </summary>
 37        [JsonConstructorAttribute]
 038        protected NewExpenseDTO() { }
 39        /// <summary>
 40        /// Initializes a new instance of the <see cref="NewExpenseDTO" /> class.
 41        /// </summary>
 42        /// <param name="personId">personId.</param>
 43        /// <param name="date">date.</param>
 44        /// <param name="description">description.</param>
 45        /// <param name="amount">amount (required).</param>
 246        public NewExpenseDTO(int personId = default(int), string date = default(string), string description = default(st
 247        {
 248            this.Amount = amount;
 249            this.PersonId = personId;
 250            this.Date = date;
 251            this.Description = description;
 252        }
 53
 54        /// <summary>
 55        /// Gets or Sets PersonId
 56        /// </summary>
 57        [DataMember(Name = "personId", EmitDefaultValue = false)]
 458        public int PersonId { get; set; }
 59
 60        /// <summary>
 61        /// Gets or Sets Date
 62        /// </summary>
 63        [DataMember(Name = "date", EmitDefaultValue = false)]
 464        public string Date { get; set; }
 65
 66        /// <summary>
 67        /// Gets or Sets Description
 68        /// </summary>
 69        [DataMember(Name = "description", EmitDefaultValue = false)]
 470        public string Description { get; set; }
 71
 72        /// <summary>
 73        /// Gets or Sets Amount
 74        /// </summary>
 75        [DataMember(Name = "amount", IsRequired = true, EmitDefaultValue = true)]
 476        public long Amount { get; set; }
 77
 78        /// <summary>
 79        /// Returns the string presentation of the object
 80        /// </summary>
 81        /// <returns>String presentation of the object</returns>
 82        public override string ToString()
 083        {
 084            StringBuilder sb = new StringBuilder();
 085            sb.Append("class NewExpenseDTO {\n");
 086            sb.Append("  PersonId: ").Append(PersonId).Append("\n");
 087            sb.Append("  Date: ").Append(Date).Append("\n");
 088            sb.Append("  Description: ").Append(Description).Append("\n");
 089            sb.Append("  Amount: ").Append(Amount).Append("\n");
 090            sb.Append("}\n");
 091            return sb.ToString();
 092        }
 93
 94        /// <summary>
 95        /// Returns the JSON string presentation of the object
 96        /// </summary>
 97        /// <returns>JSON string presentation of the object</returns>
 98        public virtual string ToJson()
 099        {
 0100            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
 0101        }
 102
 103        /// <summary>
 104        /// Returns true if objects are equal
 105        /// </summary>
 106        /// <param name="input">Object to be compared</param>
 107        /// <returns>Boolean</returns>
 108        public override bool Equals(object input)
 0109        {
 0110            return this.Equals(input as NewExpenseDTO);
 0111        }
 112
 113        /// <summary>
 114        /// Returns true if NewExpenseDTO instances are equal
 115        /// </summary>
 116        /// <param name="input">Instance of NewExpenseDTO to be compared</param>
 117        /// <returns>Boolean</returns>
 118        public bool Equals(NewExpenseDTO input)
 0119        {
 0120            if (input == null)
 0121            {
 0122                return false;
 123            }
 0124            return
 0125                (
 0126                    this.PersonId == input.PersonId ||
 0127                    this.PersonId.Equals(input.PersonId)
 0128                ) &&
 0129                (
 0130                    this.Date == input.Date ||
 0131                    (this.Date != null &&
 0132                    this.Date.Equals(input.Date))
 0133                ) &&
 0134                (
 0135                    this.Description == input.Description ||
 0136                    (this.Description != null &&
 0137                    this.Description.Equals(input.Description))
 0138                ) &&
 0139                (
 0140                    this.Amount == input.Amount ||
 0141                    this.Amount.Equals(input.Amount)
 0142                );
 0143        }
 144
 145        /// <summary>
 146        /// Gets the hash code
 147        /// </summary>
 148        /// <returns>Hash code</returns>
 149        public override int GetHashCode()
 0150        {
 151            unchecked // Overflow is fine, just wrap
 0152            {
 0153                int hashCode = 41;
 0154                hashCode = (hashCode * 59) + this.PersonId.GetHashCode();
 0155                if (this.Date != null)
 0156                {
 0157                    hashCode = (hashCode * 59) + this.Date.GetHashCode();
 0158                }
 0159                if (this.Description != null)
 0160                {
 0161                    hashCode = (hashCode * 59) + this.Description.GetHashCode();
 0162                }
 0163                hashCode = (hashCode * 59) + this.Amount.GetHashCode();
 0164                return hashCode;
 165            }
 0166        }
 167
 168        /// <summary>
 169        /// To validate all properties of the instance
 170        /// </summary>
 171        /// <param name="validationContext">Validation context</param>
 172        /// <returns>Validation Result</returns>
 173        public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validation
 0174        {
 0175            yield break;
 176        }
 177    }
 178
 179}