本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例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());
}