本文整理汇总了C#中System.Version.IsHigherThan方法的典型用法代码示例。如果您正苦于以下问题:C# Version.IsHigherThan方法的具体用法?C# Version.IsHigherThan怎么用?C# Version.IsHigherThan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Version
的用法示例。
在下文中一共展示了Version.IsHigherThan方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestMajor
public void TestMajor()
{
var version = new Version(1, 2, 3, 4);
var otherVersion = new Version(0, 2, 3, 4);
Assert.IsTrue(version.IsHigherThan(otherVersion));
Assert.IsFalse(otherVersion.IsHigherThan(version));
}
示例2: TestMinorAndBuildNumbersDiffer
public void TestMinorAndBuildNumbersDiffer()
{
var higherVersion = new Version(5, 4, 3, 2);
var lowerVersion = new Version(5, 2, 5, 2);
Assert.IsTrue(higherVersion.IsHigherThan(lowerVersion));
Assert.IsFalse(lowerVersion.IsHigherThan(higherVersion));
}
示例3: TestOnlyRevisionNumbersDiffer
public void TestOnlyRevisionNumbersDiffer()
{
var higherVersion = new Version(5, 4, 3, 2);
var lowerVersion = new Version(5, 4, 3, 1);
Assert.IsTrue(higherVersion.IsHigherThan(lowerVersion));
Assert.IsFalse(lowerVersion.IsHigherThan(higherVersion));
}
示例4: TestOnlyMajorNumbersDiffer
public void TestOnlyMajorNumbersDiffer()
{
var higherVersion = new Version(5, 4, 0, 2);
var lowerVersion = new Version(4, 4, 0, 2);
Assert.IsTrue(higherVersion.IsHigherThan(lowerVersion));
Assert.IsFalse(lowerVersion.IsHigherThan(higherVersion));
}
示例5: TestVersionsAreEqual
public void TestVersionsAreEqual()
{
var version1 = new Version(0, 4, 3, 2);
var version2 = new Version(0, 4, 3, 2);
Assert.IsFalse(version1.IsHigherThan(version2));
Assert.IsFalse(version2.IsHigherThan(version1));
}
示例6: TestUnknownRevisionNumber
public void TestUnknownRevisionNumber()
{
var higherVersion = new Version(3, 4, 0);
var lowerVersion = new Version(3, 3, 9, 9);
Assert.IsTrue(higherVersion.IsHigherThan(lowerVersion));
Assert.IsFalse(lowerVersion.IsHigherThan(higherVersion));
higherVersion = new Version(3, 4, 0, 9);
lowerVersion = new Version(3, 4, 0);
Assert.IsTrue(higherVersion.IsHigherThan(lowerVersion));
Assert.IsFalse(lowerVersion.IsHigherThan(higherVersion));
}