本文整理汇总了C#中Range.IsOverlapping方法的典型用法代码示例。如果您正苦于以下问题:C# Range.IsOverlapping方法的具体用法?C# Range.IsOverlapping怎么用?C# Range.IsOverlapping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Range
的用法示例。
在下文中一共展示了Range.IsOverlapping方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsOverlappingTest
public void IsOverlappingTest( float min1, float max1, float min2, float max2, bool expectedResult )
{
Range range1 = new Range( min1, max1 );
Range range2 = new Range( min2, max2 );
Assert.AreEqual( expectedResult, range1.IsOverlapping( range2 ) );
}
示例2: RangeOverlappingIsTrueSmaller
public void RangeOverlappingIsTrueSmaller()
{
var range1 = new Range<int>(0, 10);
var range2 = new Range<int>(3, 7);
Assert.IsTrue(range2.IsOverlapping(range1));
}
示例3: RangeOverlappingIsTrueReverse
public void RangeOverlappingIsTrueReverse()
{
var range1 = new Range<int>(5, 10);
var range2 = new Range<int>(7, 12);
Assert.IsTrue(range2.IsOverlapping(range1));
}
示例4: RangeOverlappingIsTrueItSelf
public void RangeOverlappingIsTrueItSelf()
{
var range1 = new Range<int>(0, 10);
Assert.IsTrue(range1.IsOverlapping(range1));
}
示例5: RangeOverlappingIsFalseWhenNull
public void RangeOverlappingIsFalseWhenNull()
{
var range1 = new Range<int>(5, 10);
Assert.IsFalse(range1.IsOverlapping(null));
}
示例6: RangeOverlappingIsFalseReverse
public void RangeOverlappingIsFalseReverse()
{
var range1 = new Range<int>(5, 10);
var range2 = new Range<int>(15, 20);
Assert.IsFalse(range2.IsOverlapping(range1));
}