public void TestRange ()
{
AssertAreSame (new [] {1, 2, 3, 4}, Enumerable.Range (1, 4));
-
AssertAreSame (new [] {0, 1, 2, 3}, Enumerable.Range (0, 4));
}
+ [Test]
+ public void SingleValueOfMaxInt32 ()
+ {
+ AssertAreSame (new [] { int.MaxValue }, Enumerable.Range(int.MaxValue, 1));
+ }
+
+ [Test]
+ public void EmptyRangeStartingAtMinInt32 ()
+ {
+ AssertAreSame (new int [0], Enumerable.Range(int.MinValue, 0));
+ }
+
+ static void AssertThrows<T> (Action action) where T : Exception
+ {
+ try {
+ action ();
+ Assert.Fail ();
+ } catch (T) {
+ } catch {
+ Assert.Fail ();
+ }
+ }
+
[Test]
public void TestTakeTakesProperNumberOfItems ()
{