public void GeneralPropertyCheck() { var id = new GraphId("abc"); Assert.AreEqual("abc", id.Value); Assert.AreEqual("abc", id.ToString()); Assert.AreEqual("abc".GetHashCode(), id.GetHashCode()); }
public void GraphId_Equals_Works_When_Value_Set_To(string expected) { var value = Guid.Parse(expected); var id = new GraphId(value); var other = new GraphId(value); Assert.True(id.Equals(other)); Assert.That(id.Value, Is.EqualTo(other.Value)); Assert.That(id.GetHashCode(), Is.EqualTo(other.GetHashCode())); }
public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hash = 17; hash = hash * 29 + ScriptId.GetHashCode(); hash = hash * 29 + Handle.GetHashCode(); hash = hash * 29 + NodeId.GetHashCode(); hash = hash * 29 + GraphId.GetHashCode(); return(hash); } }