public void DefaultValues() { var sut = new Proposal(); Assert.Null(sut.Name); Assert.False(sut.Relevance.HasValue); Assert.AreNotEqual(0, sut.GetHashCode()); Assert.AreNotEqual(1, sut.GetHashCode()); }
public override int GetHashCode() { unchecked { return(Bug.GetHashCode() ^ Enhancement.GetHashCode() ^ Proposal.GetHashCode() ^ Task.GetHashCode()); } }
public void Equality_Default() { var a = new Proposal(); var b = new Proposal(); Assert.AreEqual(a, b); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentRelevanceWithZero() { var a = new Proposal { Relevance = 0 }; var b = new Proposal(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentName() { var a = new Proposal { Name = Names.General("a") }; var b = new Proposal(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_ReallyTheSame() { var a = new Proposal { Name = Names.General("a"), Relevance = 3 }; var b = new Proposal { Name = Names.General("a"), Relevance = 3 }; Assert.AreEqual(a, b); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); }
public override int GetHashCode() { return(string.IsNullOrEmpty(_result) ? GetType().GetHashCode() : _result.GetHashCode() ^ Proposal.GetHashCode()); }