public override int GetHashCode() { int hashCode = Line.GetHashCode(); if (ProjectEntry != null) { hashCode ^= ProjectEntry.GetHashCode(); } return(hashCode); }
public void ParseCSharpProjectDataOfSolutionFile() { const string ProjectName = "MyCSharpProject"; const string ProjectFilePath = @"Basics\Coding.MyCSharpProject.csproj"; const string ProjectGuid = "{AAE7730E-5F62-48D6-B772-C4B1E8665FE1}"; const string ProjectEntryString = "Project(" + ProjectEntry.CSharpProjectTypeGuid + ") = \"" + ProjectName + "\", \"" + ProjectFilePath + "\", " + ProjectGuid; var projectEntry = new ProjectEntry(ProjectEntryString); Assert.IsTrue(projectEntry.IsCSharpProject); Assert.IsFalse(projectEntry.IsSolutionFolder); Assert.AreEqual(ProjectName, projectEntry.Name); Assert.AreEqual(ProjectFilePath, projectEntry.FilePath); Assert.AreEqual(ProjectGuid, projectEntry.Guid); Assert.AreEqual(-1260520527, projectEntry.GetHashCode()); Assert.IsFalse(projectEntry.Equals(new object())); Assert.IsTrue(projectEntry.Equals(new ProjectEntry(ProjectEntryString))); }