GetHashCode() 공개 메소드

public GetHashCode ( ) : int
리턴 int
예제 #1
0
		public void DefaultType ()
		{
			ToolboxItemAttribute attr = new ToolboxItemAttribute (true);
			
			Type toolboxItemType = typeof(global::System.Drawing.Design.ToolboxItem);

			Assert.AreEqual (toolboxItemType.AssemblyQualifiedName, attr.ToolboxItemTypeName, "#1");
			Assert.AreEqual (toolboxItemType, attr.ToolboxItemType, "#2");
			Assert.AreEqual (true, attr.IsDefaultAttribute (), "#3");
			Assert.AreEqual (attr.ToolboxItemTypeName.GetHashCode (), attr.GetHashCode (), "#4");

			Assert.AreEqual (toolboxItemType.AssemblyQualifiedName, ToolboxItemAttribute.Default.ToolboxItemTypeName, "#5");
			Assert.AreEqual (toolboxItemType, ToolboxItemAttribute.Default.ToolboxItemType, "#2");
			Assert.AreEqual (true, ToolboxItemAttribute.Default.IsDefaultAttribute (), "#3");
			Assert.AreEqual (ToolboxItemAttribute.Default.ToolboxItemTypeName.GetHashCode (), attr.GetHashCode (), "#4");
		}
예제 #2
0
 public void Equals_Other_ReturnsExpected(ToolboxItemAttribute attribute, object other, bool expected)
 {
     Assert.Equal(expected, attribute.Equals(other));
     if (other is ToolboxItemAttribute)
     {
         Assert.Equal(expected, attribute.GetHashCode().Equals(other.GetHashCode()));
     }
 }