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


C# SemanticVersion.GetHashCode方法代码示例

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


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

示例1: HashCodes

    public void HashCodes()
    {
        var sv12a = new SemanticVersion(new Version(1, 2), null);
        var sv12b = new SemanticVersion(new Version(1, 2), null);
        Assert.Equal(sv12a.GetHashCode(), sv12b.GetHashCode());

        var sv13 = new SemanticVersion(new Version(1, 3), null);
        Assert.NotEqual(sv12a.GetHashCode(), sv13.GetHashCode());
    }
开发者ID:jkeech,项目名称:Nerdbank.GitVersioning,代码行数:9,代码来源:SemanticVersionTests.cs

示例2: GetHashCodeNotEqualNoBuildNoPrerelease

        public void GetHashCodeNotEqualNoBuildNoPrerelease()
        {
            SemanticVersion left = new SemanticVersion(1, 0, 0);
            SemanticVersion right = new SemanticVersion(2, 0, 0);

            Assert.NotEqual(left.GetHashCode(), right.GetHashCode());
        }
开发者ID:Ruhrpottpatriot,项目名称:SemanticVersion,代码行数:7,代码来源:GetHashCodeTest.cs

示例3: GetHashCodeNotEqual

        public void GetHashCodeNotEqual()
        {
            SemanticVersion left = new SemanticVersion(1, 0, 0, "foo", "bar");
            SemanticVersion right = new SemanticVersion(2, 0, 0, "foo", "bar");

            Assert.NotEqual(left.GetHashCode(), right.GetHashCode());
        }
开发者ID:Ruhrpottpatriot,项目名称:SemanticVersion,代码行数:7,代码来源:GetHashCodeTest.cs

示例4: NormalTypeHashCodeVerification

        public void NormalTypeHashCodeVerification(ushort major, ushort minor, ushort patch)
        {
            var semVer = new SemanticVersion(major, minor, patch);

            var expected = GetSemVerHashCode(semVer);

            var actual = semVer.GetHashCode();

            Assert.Equal(expected, actual);
        }
开发者ID:cyberzed,项目名称:SemanticVersioning,代码行数:10,代码来源:SemanticVersionTests.cs

示例5: SpecialTypeHashCodeVerification

        public void SpecialTypeHashCodeVerification(SemanticVersionType semVerType, ushort major, ushort minor, ushort patch,
            string[] specialParts)
        {
            var semVer = new SemanticVersion(major, minor, patch, specialParts, semVerType);

            var expected = GetSemVerHashCode(semVer);

            var actual = semVer.GetHashCode();

            Assert.Equal(expected, actual);
        }
开发者ID:cyberzed,项目名称:SemanticVersioning,代码行数:11,代码来源:SemanticVersionTests.cs

示例6: GetHashCodeTest

        public void GetHashCodeTest()
        {
            SemanticVersion o = new SemanticVersion(4, 2, 1, new PreRelease(PreReleaseStage.ALPHA, 3), 45);
            SemanticVersion v = o;

            Assert.Equal(o.GetHashCode(), v.GetHashCode());

            v = new SemanticVersion(4, 2, 1, new PreRelease(PreReleaseStage.ALPHA, 3), 45);
            Assert.Equal(o.GetHashCode(), v.GetHashCode());
        }
开发者ID:z2xlong,项目名称:SemanticVersion,代码行数:10,代码来源:CompareTest.cs


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