public void Test2() { var arr = new[] { 1 }; var arr1 = arr.SkipLast(); var arr2 = arr.Skip(1).SkipLast(); Assert.IsFalse(arr1.Any()); Assert.IsFalse(arr2.Any()); }
public void Test1() { var arr = new[] { 1, 2, 3, 4 }; var arr1 = arr.SkipLast(); var arr2 = arr.Skip(1).SkipLast(); Assert.IsTrue(new[] { 1, 2, 3 }.SequenceEqual(arr1)); Assert.IsTrue(new[] { 2, 3 }.SequenceEqual(arr2)); }