GetHashCode() private méthode

private GetHashCode ( ) : int
Résultat int
 public void TestDiffInstances()
 {
     string str = TestLibrary.Generator.GetString(-55, false, c_MINI_STRING_LENGTH, c_MAX_STRING_LENGTH);
     StringInfo stringInfo1 = new StringInfo(str);
     StringInfo stringInfo2 = new StringInfo("");
     Assert.NotEqual(stringInfo2.GetHashCode(), stringInfo1.GetHashCode());
 }
 public void TestInstancesWithSameArg()
 {
     string str = _generator.GetString(-55, false, c_MINI_STRING_LENGTH, c_MAX_STRING_LENGTH);
     StringInfo stringInfo1 = new StringInfo(str);
     StringInfo stringInfo2 = new StringInfo(str);
     Assert.Equal(stringInfo2.GetHashCode(), stringInfo1.GetHashCode());
 }
Exemple #3
0
 public void Equals(StringInfo stringInfo, object value, bool expected)
 {
     Assert.Equal(expected, stringInfo.Equals(value));
     if (value is StringInfo)
     {
         Assert.Equal(expected, stringInfo.GetHashCode().Equals(value.GetHashCode()));
     }
 }