From 82980e63cca46781dfb2ad6fe8d39c5bae5e8ae3 Mon Sep 17 00:00:00 2001 From: aloisdg Date: Wed, 2 Sep 2015 15:11:39 +0530 Subject: [PATCH 1/2] Feat: Allow the use of Equals --- SharpResume/Model/Award.cs | 42 +++++++++++++++++++- SharpResume/Model/Basics.cs | 54 +++++++++++++++++++++++++- SharpResume/Model/Education.cs | 49 ++++++++++++++++++++++- SharpResume/Model/Interest.cs | 37 +++++++++++++++++- SharpResume/Model/Language.cs | 37 +++++++++++++++++- SharpResume/Model/Location.cs | 44 ++++++++++++++++++++- SharpResume/Model/Profile.cs | 42 +++++++++++++++++++- SharpResume/Model/Publication.cs | 44 ++++++++++++++++++++- SharpResume/Model/Reference.cs | 37 +++++++++++++++++- SharpResume/Model/Skill.cs | 42 +++++++++++++++++++- SharpResume/Model/Volunteer.cs | 49 ++++++++++++++++++++++- SharpResume/Model/Work.cs | 49 ++++++++++++++++++++++- SharpResume/Properties/AssemblyInfo.cs | 4 +- SharpResume/Resume.cs | 48 ++++++++++++++++++++++- 14 files changed, 562 insertions(+), 16 deletions(-) diff --git a/SharpResume/Model/Award.cs b/SharpResume/Model/Award.cs index 17bed09..f2239c6 100644 --- a/SharpResume/Model/Award.cs +++ b/SharpResume/Model/Award.cs @@ -2,11 +2,51 @@ namespace SharpResume.Model { - public class Award + public class Award : IEquatable { public string Title { get; set; } public DateTime Date { get; set; } public string Awarder { get; set; } public string Summary { get; set; } + + public bool Equals(Award other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return string.Equals(Title, other.Title) + && Date.Equals(other.Date) + && string.Equals(Awarder, other.Awarder) + && string.Equals(Summary, other.Summary); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Award)obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = (Title != null ? Title.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ Date.GetHashCode(); + hashCode = (hashCode * 397) ^ (Awarder != null ? Awarder.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Summary != null ? Summary.GetHashCode() : 0); + return hashCode; + } + } + + public static bool operator ==(Award left, Award right) + { + return Equals(left, right); + } + + public static bool operator !=(Award left, Award right) + { + return !Equals(left, right); + } } } \ No newline at end of file diff --git a/SharpResume/Model/Basics.cs b/SharpResume/Model/Basics.cs index c5f4bb5..0f180c5 100644 --- a/SharpResume/Model/Basics.cs +++ b/SharpResume/Model/Basics.cs @@ -1,6 +1,8 @@ +using System; + namespace SharpResume.Model { - public class Basics + public class Basics : IEquatable { public string Name { get; set; } public string Label { get; set; } @@ -11,5 +13,55 @@ public class Basics public string Summary { get; set; } public Location Location { get; set; } public Profile[] Profiles { get; set; } + + public bool Equals(Basics other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return string.Equals(Name, other.Name) + && string.Equals(Label, other.Label) + && string.Equals(Picture, other.Picture) + && string.Equals(Email, other.Email) + && string.Equals(Phone, other.Phone) + && string.Equals(Website, other.Website) + && string.Equals(Summary, other.Summary) + && Equals(Location, other.Location) + && Equals(Profiles, other.Profiles); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Basics)obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = (Name != null ? Name.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Label != null ? Label.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Picture != null ? Picture.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Email != null ? Email.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Phone != null ? Phone.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Website != null ? Website.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Summary != null ? Summary.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Location != null ? Location.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Profiles != null ? Profiles.GetHashCode() : 0); + return hashCode; + } + } + + public static bool operator ==(Basics left, Basics right) + { + return Equals(left, right); + } + + public static bool operator !=(Basics left, Basics right) + { + return !Equals(left, right); + } } } \ No newline at end of file diff --git a/SharpResume/Model/Education.cs b/SharpResume/Model/Education.cs index 4100910..d5715ce 100644 --- a/SharpResume/Model/Education.cs +++ b/SharpResume/Model/Education.cs @@ -1,13 +1,60 @@ +using System; using SharpResume.Dateable; namespace SharpResume.Model { - public class Education : ADateable + public class Education : ADateable, IEquatable { public string Institution { get; set; } public string Area { get; set; } public string StudyType { get; set; } public string Gpa { get; set; } public string[] Courses { get; set; } + + public bool Equals(Education other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return string.Equals(Institution, other.Institution) + && string.Equals(Area, other.Area) + && string.Equals(StudyType, other.StudyType) + && string.Equals(Gpa, other.Gpa) + && Equals(Courses, other.Courses) + && Start.Equals(other.Start) + && End.Equals(other.End); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Education) obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = (Institution != null ? Institution.GetHashCode() : 0); + hashCode = (hashCode*397) ^ (Area != null ? Area.GetHashCode() : 0); + hashCode = (hashCode*397) ^ (StudyType != null ? StudyType.GetHashCode() : 0); + hashCode = (hashCode*397) ^ (Gpa != null ? Gpa.GetHashCode() : 0); + hashCode = (hashCode*397) ^ (Courses != null ? Courses.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ Start.GetHashCode(); + hashCode = (hashCode * 397) ^ End.GetHashCode(); + return hashCode; + } + } + + public static bool operator ==(Education left, Education right) + { + return Equals(left, right); + } + + public static bool operator !=(Education left, Education right) + { + return !Equals(left, right); + } } } \ No newline at end of file diff --git a/SharpResume/Model/Interest.cs b/SharpResume/Model/Interest.cs index 76dff92..43c0943 100644 --- a/SharpResume/Model/Interest.cs +++ b/SharpResume/Model/Interest.cs @@ -1,8 +1,43 @@ +using System; + namespace SharpResume.Model { - public class Interest + public class Interest : IEquatable { public string Name { get; set; } public string[] Keywords { get; set; } + + public bool Equals(Interest other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return string.Equals(Name, other.Name) && Equals(Keywords, other.Keywords); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Interest)obj); + } + + public override int GetHashCode() + { + unchecked + { + return ((Name != null ? Name.GetHashCode() : 0) * 397) ^ (Keywords != null ? Keywords.GetHashCode() : 0); + } + } + + public static bool operator ==(Interest left, Interest right) + { + return Equals(left, right); + } + + public static bool operator !=(Interest left, Interest right) + { + return !Equals(left, right); + } } } \ No newline at end of file diff --git a/SharpResume/Model/Language.cs b/SharpResume/Model/Language.cs index 12e89f2..5e78289 100644 --- a/SharpResume/Model/Language.cs +++ b/SharpResume/Model/Language.cs @@ -1,8 +1,43 @@ +using System; + namespace SharpResume.Model { - public class Language + public class Language : IEquatable { public string Name { get; set; } public string Fluency { get; set; } + + public bool Equals(Language other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return string.Equals(Name, other.Name) && string.Equals(Fluency, other.Fluency); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Language)obj); + } + + public override int GetHashCode() + { + unchecked + { + return ((Name != null ? Name.GetHashCode() : 0) * 397) ^ (Fluency != null ? Fluency.GetHashCode() : 0); + } + } + + public static bool operator ==(Language left, Language right) + { + return Equals(left, right); + } + + public static bool operator !=(Language left, Language right) + { + return !Equals(left, right); + } } } \ No newline at end of file diff --git a/SharpResume/Model/Location.cs b/SharpResume/Model/Location.cs index 98a6f78..9854694 100644 --- a/SharpResume/Model/Location.cs +++ b/SharpResume/Model/Location.cs @@ -5,12 +5,54 @@ namespace SharpResume.Model { - public class Location + public class Location : IEquatable { public string Address { get; set; } public string PostalCode { get; set; } public string City { get; set; } public string CountryCode { get; set; } public string Region { get; set; } + + public bool Equals(Location other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return string.Equals(Address, other.Address) + && string.Equals(PostalCode, other.PostalCode) + && string.Equals(City, other.City) + && string.Equals(CountryCode, other.CountryCode) + && string.Equals(Region, other.Region); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Location)obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = (Address != null ? Address.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (PostalCode != null ? PostalCode.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (City != null ? City.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (CountryCode != null ? CountryCode.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Region != null ? Region.GetHashCode() : 0); + return hashCode; + } + } + + public static bool operator ==(Location left, Location right) + { + return Equals(left, right); + } + + public static bool operator !=(Location left, Location right) + { + return !Equals(left, right); + } } } diff --git a/SharpResume/Model/Profile.cs b/SharpResume/Model/Profile.cs index 25c646d..ec5b349 100644 --- a/SharpResume/Model/Profile.cs +++ b/SharpResume/Model/Profile.cs @@ -1,9 +1,49 @@ +using System; + namespace SharpResume.Model { - public class Profile + public class Profile : IEquatable { public string Network { get; set; } public string Username { get; set; } public string Url { get; set; } + + public bool Equals(Profile other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return string.Equals(Network, other.Network) + && string.Equals(Username, other.Username) + && string.Equals(Url, other.Url); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Profile)obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = (Network != null ? Network.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Username != null ? Username.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Url != null ? Url.GetHashCode() : 0); + return hashCode; + } + } + + public static bool operator ==(Profile left, Profile right) + { + return Equals(left, right); + } + + public static bool operator !=(Profile left, Profile right) + { + return !Equals(left, right); + } } } \ No newline at end of file diff --git a/SharpResume/Model/Publication.cs b/SharpResume/Model/Publication.cs index 80cb9c2..6a34bf4 100644 --- a/SharpResume/Model/Publication.cs +++ b/SharpResume/Model/Publication.cs @@ -2,12 +2,54 @@ namespace SharpResume.Model { - public class Publication + public class Publication : IEquatable { public string Name { get; set; } public string Publisher { get; set; } public DateTime Release { get; set; } public string Website { get; set; } public string Summary { get; set; } + + public bool Equals(Publication other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return string.Equals(Name, other.Name) + && string.Equals(Publisher, other.Publisher) + && Release.Equals(other.Release) + && string.Equals(Website, other.Website) + && string.Equals(Summary, other.Summary); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Publication)obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = (Name != null ? Name.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Publisher != null ? Publisher.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ Release.GetHashCode(); + hashCode = (hashCode * 397) ^ (Website != null ? Website.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Summary != null ? Summary.GetHashCode() : 0); + return hashCode; + } + } + + public static bool operator ==(Publication left, Publication right) + { + return Equals(left, right); + } + + public static bool operator !=(Publication left, Publication right) + { + return !Equals(left, right); + } } } \ No newline at end of file diff --git a/SharpResume/Model/Reference.cs b/SharpResume/Model/Reference.cs index c4d613e..28d1446 100644 --- a/SharpResume/Model/Reference.cs +++ b/SharpResume/Model/Reference.cs @@ -1,8 +1,43 @@ +using System; + namespace SharpResume.Model { - public class Reference + public class Reference : IEquatable { public string Name { get; set; } public string Comment { get; set; } + + public bool Equals(Reference other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return string.Equals(Name, other.Name) && string.Equals(Comment, other.Comment); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Reference) obj); + } + + public override int GetHashCode() + { + unchecked + { + return ((Name != null ? Name.GetHashCode() : 0)*397) ^ (Comment != null ? Comment.GetHashCode() : 0); + } + } + + public static bool operator ==(Reference left, Reference right) + { + return Equals(left, right); + } + + public static bool operator !=(Reference left, Reference right) + { + return !Equals(left, right); + } } } \ No newline at end of file diff --git a/SharpResume/Model/Skill.cs b/SharpResume/Model/Skill.cs index 5e4ebb5..949f468 100644 --- a/SharpResume/Model/Skill.cs +++ b/SharpResume/Model/Skill.cs @@ -1,9 +1,49 @@ +using System; + namespace SharpResume.Model { - public class Skill + public class Skill : IEquatable { public string Name { get; set; } public string Level { get; set; } public string[] Keywords { get; set; } + + public bool Equals(Skill other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return string.Equals(Name, other.Name) + && string.Equals(Level, other.Level) + && Equals(Keywords, other.Keywords); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Skill)obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = (Name != null ? Name.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Level != null ? Level.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Keywords != null ? Keywords.GetHashCode() : 0); + return hashCode; + } + } + + public static bool operator ==(Skill left, Skill right) + { + return Equals(left, right); + } + + public static bool operator !=(Skill left, Skill right) + { + return !Equals(left, right); + } } } \ No newline at end of file diff --git a/SharpResume/Model/Volunteer.cs b/SharpResume/Model/Volunteer.cs index 6959f75..fda0cd0 100644 --- a/SharpResume/Model/Volunteer.cs +++ b/SharpResume/Model/Volunteer.cs @@ -1,13 +1,60 @@ +using System; using SharpResume.Dateable; namespace SharpResume.Model { - public class Volunteer : ADateable + public class Volunteer : ADateable, IEquatable { public string Organization { get; set; } public string Position { get; set; } public string Website { get; set; } public string Summary { get; set; } public string[] Highlights { get; set; } + + public bool Equals(Volunteer other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return string.Equals(Organization, other.Organization) + && string.Equals(Position, other.Position) + && string.Equals(Website, other.Website) + && string.Equals(Summary, other.Summary) + && Equals(Highlights, other.Highlights) + && Start.Equals(other.Start) + && End.Equals(other.End); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Volunteer)obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = (Organization != null ? Organization.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Position != null ? Position.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Website != null ? Website.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Summary != null ? Summary.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Highlights != null ? Highlights.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ Start.GetHashCode(); + hashCode = (hashCode * 397) ^ End.GetHashCode(); + return hashCode; + } + } + + public static bool operator ==(Volunteer left, Volunteer right) + { + return Equals(left, right); + } + + public static bool operator !=(Volunteer left, Volunteer right) + { + return !Equals(left, right); + } } } \ No newline at end of file diff --git a/SharpResume/Model/Work.cs b/SharpResume/Model/Work.cs index 7a21b5e..21a34a0 100644 --- a/SharpResume/Model/Work.cs +++ b/SharpResume/Model/Work.cs @@ -1,13 +1,60 @@ +using System; using SharpResume.Dateable; namespace SharpResume.Model { - public class Work : ADateable + public class Work : ADateable, IEquatable { public string Company { get; set; } public string Position { get; set; } public string Website { get; set; } public string Summary { get; set; } public string[] Highlights { get; set; } + + public bool Equals(Work other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return string.Equals(Company, other.Company) + && string.Equals(Position, other.Position) + && string.Equals(Website, other.Website) + && string.Equals(Summary, other.Summary) + && Equals(Highlights, other.Highlights) + && Start.Equals(other.Start) + && End.Equals(other.End); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Work)obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = (Company != null ? Company.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Position != null ? Position.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Website != null ? Website.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Summary != null ? Summary.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Highlights != null ? Highlights.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ Start.GetHashCode(); + hashCode = (hashCode * 397) ^ End.GetHashCode(); + return hashCode; + } + } + + public static bool operator ==(Work left, Work right) + { + return Equals(left, right); + } + + public static bool operator !=(Work left, Work right) + { + return !Equals(left, right); + } } } \ No newline at end of file diff --git a/SharpResume/Properties/AssemblyInfo.cs b/SharpResume/Properties/AssemblyInfo.cs index ec03e4e..1a8f6a2 100644 --- a/SharpResume/Properties/AssemblyInfo.cs +++ b/SharpResume/Properties/AssemblyInfo.cs @@ -26,5 +26,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.2.2.1")] -[assembly: AssemblyFileVersion("0.2.2.1")] +[assembly: AssemblyVersion("1.1.0.0")] +[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/SharpResume/Resume.cs b/SharpResume/Resume.cs index a8fbbe4..2dff8cc 100644 --- a/SharpResume/Resume.cs +++ b/SharpResume/Resume.cs @@ -1,10 +1,11 @@ -using System.Linq.Expressions; +using System; +using System.Linq.Expressions; using Newtonsoft.Json; using SharpResume.Model; namespace SharpResume { - public class Resume + public class Resume : IEquatable { public Basics Basics { get; set; } public Work[] Work { get; set; } @@ -21,5 +22,48 @@ public static Resume Create(string json) { return JsonConvert.DeserializeObject(json); } + + public override int GetHashCode() + { + unchecked + { + var hashCode = (Basics != null ? Basics.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Work != null ? Work.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Volunteer != null ? Volunteer.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Education != null ? Education.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Awards != null ? Awards.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Publications != null ? Publications.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Skills != null ? Skills.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Languages != null ? Languages.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Interests != null ? Interests.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (References != null ? References.GetHashCode() : 0); + return hashCode; + } + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((Resume)obj); + } + + public bool Equals(Resume other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return Equals(Basics, other.Basics) && Equals(Work, other.Work) && Equals(Volunteer, other.Volunteer) && Equals(Education, other.Education) && Equals(Awards, other.Awards) && Equals(Publications, other.Publications) && Equals(Skills, other.Skills) && Equals(Languages, other.Languages) && Equals(Interests, other.Interests) && Equals(References, other.References); + } + + public static bool operator ==(Resume resume1, Resume resume2) + { + return resume1.Equals(resume2); + } + + public static bool operator !=(Resume resume1, Resume resume2) + { + return !resume1.Equals(resume2); + } } } From 5969431cfc5f00973ab714f579923999a9feee42 Mon Sep 17 00:00:00 2001 From: aloisdg Date: Wed, 2 Sep 2015 18:05:20 +0530 Subject: [PATCH 2/2] Feat: Add test for 1.1.0 --- SharpResume.Tests/SharpResume.Tests.csproj | 9 ++++++--- SharpResume.Tests/UnitTest.cs | 8 ++++++++ SharpResume.Tests/packages.config | 1 - 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/SharpResume.Tests/SharpResume.Tests.csproj b/SharpResume.Tests/SharpResume.Tests.csproj index 5c9569b..34a595c 100644 --- a/SharpResume.Tests/SharpResume.Tests.csproj +++ b/SharpResume.Tests/SharpResume.Tests.csproj @@ -44,9 +44,6 @@ False ..\packages\NUnit.3.0.0-beta-3\lib\net45\nunit.framework.dll - - ..\packages\SharpResume.1.0.0\lib\SharpResume.dll - @@ -69,6 +66,12 @@ + + + {c207a6eb-840f-4501-87b3-029ad9c9a212} + SharpResume + + diff --git a/SharpResume.Tests/UnitTest.cs b/SharpResume.Tests/UnitTest.cs index a5ee5d1..8b2506f 100644 --- a/SharpResume.Tests/UnitTest.cs +++ b/SharpResume.Tests/UnitTest.cs @@ -30,5 +30,13 @@ public void TestCoursesCount() var educations = _expected.education.ToObject>(); Assert.AreEqual(educations.Count, _resume.Education.Length); } + + [Test] + public void TestEquals() + { + var e1 = new Resume { Basics = new Basics { Name = "Alois" } }; + var e2 = new Resume { Basics = new Basics { Name = "Alois" } }; + Assert.AreEqual(e1, e2); + } } } diff --git a/SharpResume.Tests/packages.config b/SharpResume.Tests/packages.config index d182c80..fdb5329 100644 --- a/SharpResume.Tests/packages.config +++ b/SharpResume.Tests/packages.config @@ -2,5 +2,4 @@ - \ No newline at end of file