本文整理汇总了C#中Range.Crosses方法的典型用法代码示例。如果您正苦于以下问题:C# Range.Crosses方法的具体用法?C# Range.Crosses怎么用?C# Range.Crosses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Range
的用法示例。
在下文中一共展示了Range.Crosses方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: crosses_range
public void crosses_range() {
var a = new Range(1, 2);
var b = new Range(2, 6);
var c = new Range(3, 5);
var d = new Range(5, 7);
var e = new Range(3, 3);
Assert.False(a.Crosses(a));
Assert.False(a.Crosses(b));
Assert.False(a.Crosses(c));
Assert.False(a.Crosses(d));
Assert.False(a.Crosses(e));
Assert.False(b.Crosses(a));
Assert.False(b.Crosses(b));
Assert.False(b.Crosses(c));
Assert.False(b.Crosses(d));
Assert.True(b.Crosses(e));
Assert.False(c.Crosses(a));
Assert.False(c.Crosses(b));
Assert.False(c.Crosses(c));
Assert.False(c.Crosses(d));
Assert.False(c.Crosses(e));
Assert.False(d.Crosses(a));
Assert.False(d.Crosses(b));
Assert.False(d.Crosses(c));
Assert.False(d.Crosses(d));
Assert.False(d.Crosses(e));
Assert.False(e.Crosses(a));
Assert.True(e.Crosses(b));
Assert.False(e.Crosses(c));
Assert.False(e.Crosses(d));
Assert.False(e.Crosses(e));
}
示例2: crosses_value
public void crosses_value() {
var a = new Range(1, 2);
var b = new Range(3);
Assert.False(a.Crosses(0));
Assert.False(a.Crosses(1));
Assert.True(a.Crosses(1.5));
Assert.False(a.Crosses(2));
Assert.False(a.Crosses(3));
Assert.False(b.Crosses(2));
Assert.False(b.Crosses(3));
Assert.False(b.Crosses(4));
}