本文整理汇总了C#中Range.IsSatisfied方法的典型用法代码示例。如果您正苦于以下问题:C# Range.IsSatisfied方法的具体用法?C# Range.IsSatisfied怎么用?C# Range.IsSatisfied使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Range
的用法示例。
在下文中一共展示了Range.IsSatisfied方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test02
public void Test02()
{
var range = new Range("1.2.7 || >=1.2.9 <2.0.0");
Assert.True(range.IsSatisfied(new Version("1.2.7")));
Assert.True(range.IsSatisfied(new Version("1.2.9")));
Assert.True(range.IsSatisfied(new Version("1.4.6")));
Assert.False(range.IsSatisfied(new Version("1.2.8")));
Assert.False(range.IsSatisfied(new Version("2.0.0")));
}
示例2: Ranges
public void Ranges(string rangeString, string versionString)
{
var range = new Range(rangeString);
// Version doesn't satisfy range in strict mode
Assert.False(range.IsSatisfied(versionString, false));
// Version satisfies range in loose mode
Assert.True(range.IsSatisfied(versionString, true));
}
示例3: Test01
public void Test01()
{
var range = new Range(">=1.2.7 <1.3.0");
Assert.True(range.IsSatisfied(new Version("1.2.7")));
Assert.True(range.IsSatisfied(new Version("1.2.8")));
Assert.True(range.IsSatisfied(new Version("1.2.99")));
Assert.False(range.IsSatisfied(new Version("1.2.6")));
Assert.False(range.IsSatisfied(new Version("1.3.0")));
Assert.False(range.IsSatisfied(new Version("1.1.0")));
}
示例4: ExcludedAdvancedRangePreRelease
public void ExcludedAdvancedRangePreRelease(string rangeString, string versionString)
{
var range = new Range(rangeString);
var version = new Version(versionString);
Assert.False(range.IsSatisfied(version));
}
示例5: MatchingAdvancedRangePreRelease
public void MatchingAdvancedRangePreRelease(string rangeString, string versionString)
{
var range = new Range(rangeString);
var version = new Version(versionString);
Assert.True(range.IsSatisfied(version));
}
示例6: UnsatisfiedRanges
public void UnsatisfiedRanges(string rangeString, string versionString, bool loose)
{
var range = new Range(rangeString, loose);
var version = new Version(versionString, loose);
Assert.False(range.IsSatisfied(version));
}
示例7: SatisfiedRanges
public void SatisfiedRanges(string rangeString, string versionString)
{
var range = new Range(rangeString);
var version = new Version(versionString);
Assert.True(range.IsSatisfied(version));
}