public void GetStableHashCode_Equivalent() { var set = new HashSet <int>(); foreach (var exprs in TestCases.GetExpressionsEquivalent()) { var n = exprs.Select(TestCases.GetHashCode).Distinct().Count(); Assert.AreEqual(1, n, exprs.First().ToString()); } }
public void GetStableHashCode_All_StableLocally() { RepeatTest(() => { var hs1 = TestCases.GetHashes(); var hs2 = TestCases.GetHashes(); AssertEqual(hs1, hs2); }); }
public void GetStableHashCode_Unique() { var set = new HashSet <int>(); foreach (var expr in TestCases.GetExpressionsUnique()) { var h = TestCases.GetHashCode(expr); Assert.IsTrue(set.Add(h), expr?.ToString() ?? "null"); } }
public void GetStableHashCode_All_CrossProc() { var local = TestCases.GetHashes().ToArray(); RepeatTest(() => { var hs1 = TestCases.GetHashes(); var hs2 = GetHashesOutOfProc(); AssertEqual(hs1, hs2); }); }