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


C# Range.Union方法代码示例

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


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

示例1: UnionWithTouchShouldUnion

		public void UnionWithTouchShouldUnion(int s1, int e1, int s2, int e2, int s, int e)
		{
			var r1 = new Range<int>(s1, e1);
			var r2 = new Range<int>(s2, e2);
			var r = e >= 0 ? (Range<int>?)new Range<int>(s, e) : null;
			Assert.AreEqual(r, r1.Union(r2, i => i + 1));
			Assert.AreEqual(r, r2.Union(r1, i => i + 1));
		}
开发者ID:picoe,项目名称:Eto,代码行数:8,代码来源:RangeTests.cs

示例2: GetUnionWithNoCommonality

 public void GetUnionWithNoCommonality()
 {
     var range = new Range<int>(3, 6);
     Assert.IsNull(range.Union(new Range<int>(7, 10)));
 }
开发者ID:AllenConway,项目名称:SpackleNet,代码行数:5,代码来源:RangeTests.cs

示例3: GetUnionWithCurrentRangeHavingStartAndTargetHavingEnd

        public void GetUnionWithCurrentRangeHavingStartAndTargetHavingEnd()
        {
            var range = new Range<int>(3, 6);
            var union = range.Union(new Range<int>(4, 10));

            Assert.AreEqual(3, union.Start);
            Assert.AreEqual(10, union.End);
        }
开发者ID:AllenConway,项目名称:SpackleNet,代码行数:8,代码来源:RangeTests.cs

示例4: GetUnionWhereTargetDefinesUnion

        public void GetUnionWhereTargetDefinesUnion()
        {
            var range = new Range<int>(3, 6);
            var union = range.Union(new Range<int>(1, 10));

            Assert.AreEqual(1, union.Start);
            Assert.AreEqual(10, union.End);
        }
开发者ID:AllenConway,项目名称:SpackleNet,代码行数:8,代码来源:RangeTests.cs

示例5: RangeUnion01Test

		public void RangeUnion01Test()
		{
			Range<int> r1;
			Range<int> r2;

			r1 = new Range<int>(10, 20);
			r2 = new Range<int>(10, 20);
			Assert.AreEqual(new Range<int>(10, 20), r1.Union(r2, false));

			r1 = new Range<int>(10, 20);
			r2 = new Range<int>(20, 30);
			Assert.AreEqual(new Range<int>(10, 30), r1.Union(r2, false));

			r1 = new Range<int>(10, 20);
			r2 = new Range<int>(12, 24);
			Assert.AreEqual(new Range<int>(10, 24), r1.Union(r2, false));

			r1 = new Range<int>(10, 20);
			r2 = new Range<int>(8, 12);
			Assert.AreEqual(new Range<int>(8, 20), r1.Union(r2, false));

			r1 = new Range<int>(10, 20);
			r2 = new Range<int>(12, 18);
			Assert.AreEqual(new Range<int>(10, 20), r1.Union(r2, false));

			r1 = new Range<int>(10, 20);
			r2 = new Range<int>(8, 22);
			Assert.AreEqual(new Range<int>(8, 22), r1.Union(r2, false));
		}
开发者ID:codetuner,项目名称:Arebis.Common,代码行数:29,代码来源:RangeTests.cs

示例6: RangeUnion02Test

		public void RangeUnion02Test()
		{
			Range<int> r1;
			Range<int> r2;

			r1 = new Range<int>(5, 10);
			r2 = new Range<int>(12, 16);

			Range<int> union = r1.Union(r2, false);
		}
开发者ID:codetuner,项目名称:Arebis.Common,代码行数:10,代码来源:RangeTests.cs

示例7: Union

 public void Union()
 {
     var r1 = new Range<int>(10, 20);
     var r2 = new Range<int>(15, 25);
     var union = r1.Union(r2);
     Assert.AreEqual(10, union.Start);
     Assert.AreEqual(25, union.End);
 }
开发者ID:avgx,项目名称:OrigoDB,代码行数:8,代码来源:RangeTests.cs


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