private void Page_Load(object sender, System.EventArgs e) { HtmlForm frm = (HtmlForm)FindControl("Form1"); GHTTestBegin(frm); // Call twice with the same instance should provide the same result. this.GHTSubTestBegin("Two calls by the same object."); try { bool flag1; ListItem item1 = new ListItem("Text", "Value"); if (item1.GetHashCode() == item1.GetHashCode()) { flag1 = true; } else { flag1 = false; } this.GHTSubTestAddResult(flag1.ToString()); } catch (Exception exception5) { this.GHTSubTestUnexpectedExceptionCaught(exception5); } this.GHTSubTestEnd(); // Equal items (value equality, and not ref equality) should provide the same hashcode. this.GHTSubTestBegin("Equal items "); try { bool flag2; ListItem item2 = new ListItem("Text", "Value"); ListItem item3 = new ListItem("Text", "Value"); if (item2.GetHashCode() == item3.GetHashCode()) { flag2 = true; } else { flag2 = false; } this.GHTSubTestAddResult(flag2.ToString()); } catch (Exception exception6) { this.GHTSubTestUnexpectedExceptionCaught(exception6); } this.GHTSubTestEnd(); // Not equal items (different text) should provide the diffrent hashcode. this.GHTSubTestBegin("Not equal items "); try { bool flag3; ListItem item4 = new ListItem("Text1", "Value"); ListItem item5 = new ListItem("Text2", "Value"); if (item4.GetHashCode() == item5.GetHashCode()) { flag3 = true; } else { flag3 = false; } this.GHTSubTestAddResult(flag3.ToString()); } catch (Exception exception7) { // ProjectData.SetProjectError(exception7); Exception exception3 = exception7; this.GHTSubTestUnexpectedExceptionCaught(exception3); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); // Not equal items (different value) should provide the diffrent hashcode. this.GHTSubTestBegin("Not equal items "); try { bool flag4; ListItem item6 = new ListItem("Text", "Value1"); ListItem item7 = new ListItem("Text", "Value2"); if (item6.GetHashCode() == item7.GetHashCode()) { flag4 = true; } else { flag4 = false; } this.GHTSubTestAddResult(flag4.ToString()); } catch (Exception exception8) { // ProjectData.SetProjectError(exception8); Exception exception4 = exception8; this.GHTSubTestUnexpectedExceptionCaught(exception4); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTTestEnd(); }