当前位置: 首页>>代码示例>>C#>>正文


C# Union.GetHashCode方法代码示例

本文整理汇总了C#中Union.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# Union.GetHashCode方法的具体用法?C# Union.GetHashCode怎么用?C# Union.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Union的用法示例。


在下文中一共展示了Union.GetHashCode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DifferentT1T3Values_AreNotEqualAndHaveDifferentHashCodes

 public void DifferentT1T3Values_AreNotEqualAndHaveDifferentHashCodes()
 {
     var a = new Union<int, string, Colors>(0);
     var b = new Union<int, string, Colors>(Colors.Green);
     IsFalse(a.Equals(b));
     IsTrue(a != b);
     AreNotEqual(a.GetHashCode(), b.GetHashCode());
 }
开发者ID:martijnhoekstra,项目名称:SuccincT,代码行数:8,代码来源:UnionT1T2T3EqualityTests.cs

示例2: SameT3Values_AreEqualAndHaveSameHashCode

 public void SameT3Values_AreEqualAndHaveSameHashCode()
 {
     var a = new Union<int, string, Colors>(Colors.Blue);
     var b = new Union<int, string, Colors>(Colors.Blue);
     IsTrue(a.Equals(b));
     IsTrue(a == b);
     AreEqual(a.GetHashCode(), b.GetHashCode());
 }
开发者ID:martijnhoekstra,项目名称:SuccincT,代码行数:8,代码来源:UnionT1T2T3EqualityTests.cs

示例3: DifferentValues_AreNotEqualAndHaveDifferentHashCodes

 public void DifferentValues_AreNotEqualAndHaveDifferentHashCodes()
 {
     var a = new Union<int, string>(0);
     var b = new Union<int, string>("1234");
     IsFalse(a.Equals(b));
     IsTrue(a != b);
     AreNotEqual(a.GetHashCode(), b.GetHashCode());
 }
开发者ID:chamook,项目名称:SuccincT,代码行数:8,代码来源:UnionT1T2EqualityTests.cs

示例4: SameT2Values_AreEqualAndHaveSameHashCode

 public void SameT2Values_AreEqualAndHaveSameHashCode()
 {
     var a = new Union<int, string>("1234");
     var b = new Union<int, string>("1234");
     IsTrue(a.Equals(b));
     IsTrue(a == b);
     AreEqual(a.GetHashCode(), b.GetHashCode());
 }
开发者ID:chamook,项目名称:SuccincT,代码行数:8,代码来源:UnionT1T2EqualityTests.cs

示例5: SameT4Values_AreEqualAndHaveSameHashCode

 public void SameT4Values_AreEqualAndHaveSameHashCode()
 {
     var a = new Union<int, string, Colors, Animals>(Animals.Cat);
     var b = new Union<int, string, Colors, Animals>(Animals.Cat);
     IsTrue(a.Equals(b));
     IsTrue(a == b);
     AreEqual(a.GetHashCode(), b.GetHashCode());
 }
开发者ID:chamook,项目名称:SuccincT,代码行数:8,代码来源:UnionT1T2T3T4EqualityTests.cs

示例6: DifferentT3T4Values_AreNotEqualAndHaveDifferentHashCodes

 public void DifferentT3T4Values_AreNotEqualAndHaveDifferentHashCodes()
 {
     var a = new Union<int, string, Colors, Animals>(Colors.Red);
     var b = new Union<int, string, Colors, Animals>(Animals.Cow);
     IsFalse(a.Equals(b));
     IsTrue(a != b);
     AreNotEqual(a.GetHashCode(), b.GetHashCode());
 }
开发者ID:chamook,项目名称:SuccincT,代码行数:8,代码来源:UnionT1T2T3T4EqualityTests.cs


注:本文中的Union.GetHashCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。