本文整理汇总了C#中Range.SequenceEqual方法的典型用法代码示例。如果您正苦于以下问题:C# Range.SequenceEqual方法的具体用法?C# Range.SequenceEqual怎么用?C# Range.SequenceEqual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Range
的用法示例。
在下文中一共展示了Range.SequenceEqual方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StepAmountDescending
public void StepAmountDescending()
{
var subject = new Range<int>(0, 5).Step(-1);
Assert.IsTrue(subject.SequenceEqual(new [] { 5, 4, 3, 2, 1, 0 }));
}
示例2: Descending
public void Descending()
{
var subject = new Range<int>(0, 5).FromEnd(x => x - 2);
Assert.IsTrue(subject.SequenceEqual(new int[] { 5, 3, 1 }));
}
示例3: StepAlternativeAmountDescending
public void StepAlternativeAmountDescending()
{
var subject = new Range<DateTime>(new DateTime(2000, 1, 1), new DateTime(2000, 1, 5)).Step(TimeSpan.FromDays(-1));
Assert.IsTrue(subject.SequenceEqual
(new[] { new DateTime(2000, 1, 5),
new DateTime(2000, 1, 4),
new DateTime(2000, 1, 3),
new DateTime(2000, 1, 2),
new DateTime(2000, 1, 1)}));
}
示例4: StepAmountAscending
public void StepAmountAscending()
{
var subject = new Range<int>(0, 5).Step(1);
Assert.IsTrue(subject.SequenceEqual(new [] { 0, 1, 2, 3, 4, 5 }));
}
示例5: UpByAlternative
public void UpByAlternative()
{
var subject = new Range<DateTime>(new DateTime(2000, 1, 1), new DateTime(2000, 1, 5)).UpBy(TimeSpan.FromDays(1));
Assert.IsTrue(subject.SequenceEqual
(new[] { new DateTime(2000, 1, 1),
new DateTime(2000, 1, 2),
new DateTime(2000, 1, 3),
new DateTime(2000, 1, 4),
new DateTime(2000, 1, 5)}));
}
示例6: UpBy
public void UpBy()
{
var subject = new Range<int>(0, 5).UpBy(2);
Assert.IsTrue(subject.SequenceEqual(new int[] { 0, 2, 4 }));
}
示例7: DownBy
public void DownBy()
{
var subject = new Range<int>(0, 5).DownBy(2);
Assert.IsTrue(subject.SequenceEqual(new int[] { 5, 3, 1 }));
}
示例8: Ascending
public void Ascending()
{
var subject = new Range<int>(0, 5).FromStart(x => x + 2);
Assert.IsTrue(subject.SequenceEqual(new int[] { 0, 2, 4 }));
}
示例9: SinglePointInclusiveRangeYieldsSingleValue
public void SinglePointInclusiveRangeYieldsSingleValue()
{
var subject = new Range<int>(3, 3).UpBy(1);
Assert.IsTrue(subject.SequenceEqual(new[] { 3 }));
}