public override int GetHashCode() { int hash = 5381 * output.GetHashCode(); for (int i = 0; i < input.Length; i++) { hash = 33 * hash + (input[i] == null ? i : input[i].GetHashCode()); } return(hash); }
public void GetHashCode_WorksForClass() { var _SUT1 = new SemanticType <TestClass>(_TestClass); var _SUT2 = new SemanticType <TestClass>(_TestClass); var _SUT3 = new SemanticType <TestClass>(_OtherTestClass); var hashcode1 = _SUT1.GetHashCode(); var hashcode2 = _SUT2.GetHashCode(); var hashcode3 = _SUT3.GetHashCode(); Assert.That(hashcode1 == hashcode2); Assert.That(hashcode1 != hashcode3); }
public void GetHashCode_WorksForClass() { var _SUT1 = new SemanticType<TestClass>(_TestClass); var _SUT2 = new SemanticType<TestClass>(_TestClass); var _SUT3 = new SemanticType<TestClass>(_OtherTestClass); var hashcode1 = _SUT1.GetHashCode(); var hashcode2 = _SUT2.GetHashCode(); var hashcode3 = _SUT3.GetHashCode(); Assert.That(hashcode1 == hashcode2); Assert.That(hashcode1 != hashcode3); }