public void TestGetHashcode(string item1, string item2, string item3, string item4, string item5) { var fst = new ColumnInfo(item1, item2, item3, item4, item5); var snd = new ColumnInfo(item1, item2, item3, item4, item5); Assert.Equal(snd.GetHashCode(), fst.GetHashCode()); }
public override int GetHashCode() { unchecked { var hashCode = (ColumnInfo != null ? ColumnInfo.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (NewColumnName != null ? NewColumnName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ IsRowVersion.GetHashCode(); hashCode = (hashCode * 397) ^ PrimaryKey.GetHashCode(); hashCode = (hashCode * 397) ^ InsertIgnore.GetHashCode(); hashCode = (hashCode * 397) ^ (EnumDeclaration != null ? EnumDeclaration.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Exclude.GetHashCode(); hashCode = (hashCode * 397) ^ (ForgeinKeyDeclarations != null ? ForgeinKeyDeclarations.GetHashCode() : 0); return(hashCode); } }
public void TestGetHashcode() { Tuple<string, string, string, string, string>[] tests = { Tuple.Create("", "", "", "", ""), Tuple.Create("name","", "", "", ""), Tuple.Create("name","db", "", "", ""), Tuple.Create("name","db", "table", "", ""), Tuple.Create("name","db", "table", "column", ""), Tuple.Create("name","db", "table", "column", "Variant"), }; foreach (var test in tests) { var fst = new ColumnInfo(test.Item1, test.Item2, test.Item3, test.Item4, test.Item5); var snd = new ColumnInfo(test.Item1, test.Item2, test.Item3, test.Item4, test.Item5); Assert.Equal(fst.GetHashCode(), snd.GetHashCode()); } }
public void TestGetHashcode() { Tuple <string, string, string, string, string>[] tests = { Tuple.Create("", "", "", "", ""), Tuple.Create("name", "", "", "", ""), Tuple.Create("name", "db", "", "", ""), Tuple.Create("name", "db", "table", "", ""), Tuple.Create("name", "db", "table", "column", ""), Tuple.Create("name", "db", "table", "column", "Variant"), }; foreach (var test in tests) { var fst = new ColumnInfo(test.Item1, test.Item2, test.Item3, test.Item4, test.Item5); var snd = new ColumnInfo(test.Item1, test.Item2, test.Item3, test.Item4, test.Item5); Assert.Equal(fst.GetHashCode(), snd.GetHashCode()); } }