本文整理汇总了C#中System.Security.Policy.Evidence.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# Evidence.GetHashCode方法的具体用法?C# Evidence.GetHashCode怎么用?C# Evidence.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.Policy.Evidence
的用法示例。
在下文中一共展示了Evidence.GetHashCode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Equals_GetHashCode
public void Equals_GetHashCode ()
{
Evidence e1 = new Evidence ();
Evidence e2 = new Evidence ();
Assert.AreEqual (e1.GetHashCode (), e2.GetHashCode (), "GetHashCode-1");
Assert.IsTrue (e1.Equals (e2), "e1.Equals(e2)");
e1.AddAssembly (String.Empty);
e2.AddAssembly (String.Empty);
Assert.AreEqual (e1.GetHashCode (), e2.GetHashCode (), "GetHashCode-2");
e1.AddHost (String.Empty);
e2.AddHost (String.Empty);
Assert.AreEqual (e1.GetHashCode (), e2.GetHashCode (), "GetHashCode-3");
Assert.IsTrue (e2.Equals (e1), "e2.Equals(e1)");
}
示例2: Equals_GetHashCode
public void Equals_GetHashCode ()
{
Evidence e1 = new Evidence ();
Evidence e2 = new Evidence ();
AssertEquals ("GetHashCode-1", e1.GetHashCode (), e2.GetHashCode ());
Assert ("e1.Equals(e2)", e1.Equals (e2));
e1.AddAssembly (String.Empty);
e2.AddAssembly (String.Empty);
AssertEquals ("GetHashCode-2", e1.GetHashCode (), e2.GetHashCode ());
e1.AddHost (String.Empty);
e2.AddHost (String.Empty);
AssertEquals ("GetHashCode-3", e1.GetHashCode (), e2.GetHashCode ());
Assert ("e2.Equals(e1)", e2.Equals (e1));
}
示例3: Equals_GetHashCode
public void Equals_GetHashCode ()
{
Evidence e1 = new Evidence ();
Evidence e2 = new Evidence ();
Assert.IsTrue (e1.GetHashCode () != e2.GetHashCode (), "GetHashCode");
Assert.IsTrue (!e1.Equals (e2), "!e1.Equals(e2)");
Assert.IsTrue (!e2.Equals (e1), "!e2.Equals(e1)");
}