当前位置: 首页>>代码示例>>C#>>正文


C# System.Linq.IntersectionCount方法代码示例

本文整理汇总了C#中System.Linq.IntersectionCount方法的典型用法代码示例。如果您正苦于以下问题:C# System.Linq.IntersectionCount方法的具体用法?C# System.Linq.IntersectionCount怎么用?C# System.Linq.IntersectionCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Linq的用法示例。


在下文中一共展示了System.Linq.IntersectionCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IntersectionCount_OuterStrictLowerBounds

 public void IntersectionCount_OuterStrictLowerBounds()
 {
     var ranges = new[] { Range(0, 5, true), Range(1, 4) };
     var intersectionCounts = ranges.IntersectionCount().ToList();
     intersectionCounts[0].Should().Be(new NumberRangeIntersectionCount<int>(new[] { ranges[0] }, Range(0, 1, true)));
     intersectionCounts[1].Should().Be(new NumberRangeIntersectionCount<int>(new[] { ranges[0], ranges[1] }, Range(1, 4)));
     intersectionCounts[2].Should().Be(new NumberRangeIntersectionCount<int>(new[] { ranges[0] }, Range(4, 5)));
 }
开发者ID:ApocalypticOctopus,项目名称:Apocalyptic.Utilities.Net,代码行数:8,代码来源:NumberRangeTests.cs

示例2: IntersectionCount_Gaps

 public void IntersectionCount_Gaps()
 {
     var ranges = new[] { Range(0, 5), Range(7, 10) };
     var intersectionCounts = ranges.IntersectionCount().ToList();
     intersectionCounts[0].Should().Be(new NumberRangeIntersectionCount<int>(new[] { ranges[0] }, Range(0, 5)));
     intersectionCounts[1].Should().Be(new NumberRangeIntersectionCount<int>(new INumberRange<int>[0], Range(5, 7)));
     intersectionCounts[2].Should().Be(new NumberRangeIntersectionCount<int>(new[] { ranges[1] }, Range(7, 10)));
 }
开发者ID:ApocalypticOctopus,项目名称:Apocalyptic.Utilities.Net,代码行数:8,代码来源:NumberRangeTests.cs

示例3: IntersectionCount_InnerNonStrictUpperBounds

 public void IntersectionCount_InnerNonStrictUpperBounds()
 {
     var ranges = new[] { Range(0, 5), Range(1, 4, false, false) };
     var intersectionCounts = ranges.IntersectionCount().ToList();
     intersectionCounts[0].Should().Be(new NumberRangeIntersectionCount<int>(new[] { ranges[0] }, Range(0, 1)));
     intersectionCounts[1].Should().Be(new NumberRangeIntersectionCount<int>(new[] { ranges[0], ranges[1] }, Range(1, 4, false, false)));
     intersectionCounts[2].Should().Be(new NumberRangeIntersectionCount<int>(new[] { ranges[0] }, Range(4, 5, true)));
 }
开发者ID:ApocalypticOctopus,项目名称:Apocalyptic.Utilities.Net,代码行数:8,代码来源:NumberRangeTests.cs

示例4: IntersectionCount

 public void IntersectionCount()
 {
     var ranges = new[] { Range(0, 5), Range(1, 4) };
     var intersectionCounts = ranges.IntersectionCount().ToList();
     intersectionCounts[0].Should().Be(new NumberRangeIntersectionCount<int>(new[] { ranges[0] }, Range(0, 1)));
     intersectionCounts[1].Should().Be(new NumberRangeIntersectionCount<int>(new[] { ranges[0], ranges[1] }, Range(1, 4)));
     intersectionCounts[2].Should().Be(new NumberRangeIntersectionCount<int>(new[] { ranges[0] }, Range(4, 5)));
 }
开发者ID:ApocalypticOctopus,项目名称:Apocalyptic.Utilities.Net,代码行数:8,代码来源:NumberRangeTests.cs


注:本文中的System.Linq.IntersectionCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。