示例#1
0
        public void InputNull()
        {
            IReadOnlyList <int> list = null;

            new Action(
                () => FastLinq.ElementAt(list, 0))
            .Should()
            .Throw <ArgumentNullException>();
        }
        public void InputEmpty()
        {
            IReadOnlyList <int> list = new int[] { };

            new Action(
                () => FastLinq.ElementAt(list, 0))
            .Should()
            .Throw <ArgumentOutOfRangeException>();
        }
示例#3
0
        public void IndexTooLarge()
        {
            IReadOnlyList <int> list = new[] { 1, 2, 3 };

            new Action(
                () => FastLinq.ElementAt(list, 100))
            .Should()
            .Throw <ArgumentOutOfRangeException>();
        }
示例#4
0
        public void NegativeIndex()
        {
            IReadOnlyList <int> list = new[] { 1, 2, 3 };

            new Action(
                () => FastLinq.ElementAt(list, -1))
            .Should()
            .Throw <ArgumentOutOfRangeException>();
        }
示例#5
0
        public void NominalCase()
        {
            IReadOnlyList <int> list = new[] { 1, 2, 3 };

            Assert.AreEqual(3, FastLinq.ElementAt(list, 2));
        }
示例#6
0
 public void Array_FastLinq()
 {
     var _ = FastLinq.ElementAt(this.array, ElementToRequest);
 }
示例#7
0
 public void List_FastLinq()
 {
     var _ = FastLinq.ElementAt(this.list, ElementToRequest);
 }