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


C# HashCodeCombiner.GetCombinedHashCode方法代码示例

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


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

示例1: HashCombiner_Test_Int

        public void HashCombiner_Test_Int()
        {
            var combiner1 = new HashCodeCombiner();
            combiner1.AddInt(1234);

            var combiner2 = new HashCodeCombiner();
            combiner2.AddInt(1234);

            Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode());

            combiner2.AddInt(1);

            Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode());
        }
开发者ID:joonhwan,项目名称:NPoco,代码行数:14,代码来源:HashCodeCombinerTests.cs

示例2: HashCombiner_Test_String

        public void HashCombiner_Test_String()
        {
            var combiner1 = new HashCodeCombiner();
            combiner1.AddCaseInsensitiveString("Hello");

            var combiner2 = new HashCodeCombiner();
            combiner2.AddCaseInsensitiveString("hello");

            Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode());

            combiner2.AddCaseInsensitiveString("world");

            Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode());
        }
开发者ID:joonhwan,项目名称:NPoco,代码行数:14,代码来源:HashCodeCombinerTests.cs

示例3: HashCombiner_Test_Type

        public void HashCombiner_Test_Type()
        {
            var combiner1 = new HashCodeCombiner();
            combiner1.AddType(typeof(HashCodeCombiner));

            var combiner2 = new HashCodeCombiner();
            combiner2.AddType(typeof(HashCodeCombiner));

            var combiner3 = new HashCodeCombiner();
            combiner3.AddType(typeof(HashCodeCombinerTests));

            Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode());
            Assert.AreNotEqual(combiner2.GetCombinedHashCode(), combiner3.GetCombinedHashCode());

            combiner2.AddType(typeof(HashCodeCombiner));

            Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode());
        }
开发者ID:joonhwan,项目名称:NPoco,代码行数:18,代码来源:HashCodeCombinerTests.cs

示例4: HashCombiner_Test_Bool

        public void HashCombiner_Test_Bool()
        {
            var combiner1 = new HashCodeCombiner();
            combiner1.AddBool(true);

            var combiner2 = new HashCodeCombiner();
            combiner2.AddBool(true);

            var combiner3 = new HashCodeCombiner();
            combiner3.AddBool(false);

            Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode());
            Assert.AreNotEqual(combiner2.GetCombinedHashCode(), combiner3.GetCombinedHashCode());

            combiner2.AddBool(true);

            Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode());
        }
开发者ID:joonhwan,项目名称:NPoco,代码行数:18,代码来源:HashCodeCombinerTests.cs


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