forked from dotnet/corefx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSkipTests.cs
More file actions
35 lines (30 loc) · 946 Bytes
/
SkipTests.cs
File metadata and controls
35 lines (30 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Xunit;
namespace System.Linq.Tests
{
public class SkipTests : EnumerableBasedTests
{
[Fact]
public void SkipSome()
{
Assert.Equal(Enumerable.Range(10, 10).AsQueryable(), Enumerable.Range(0, 20).AsQueryable().Skip(10));
}
[Fact]
public void SkipExcessive()
{
Assert.Empty(Enumerable.Range(0, 20).AsQueryable().Skip(42));
}
[Fact]
public void SkipThrowsOnNull()
{
Assert.Throws<ArgumentNullException>("source", () => ((IQueryable<DateTime>)null).Skip(3));
}
[Fact]
public void Skip()
{
var count = (new int[] { 0, 1, 2 }).AsQueryable().Skip(1).Count();
Assert.Equal(2, count);
}
}
}