Beispiel #1
0
        public void Find_ThrowsIndexOutOfRangeException_When_Index_LessThan_Zero()
        {
            _sqList.Insert(0, 100);
            _sqList.Insert(1, 11);
            _sqList.Insert(2, 22);
            _sqList.Insert(3, 33);

            Exception ex = Assert.Throws<IndexOutOfRangeException>(() => _sqList.Find(-1));
            Assert.IsType<IndexOutOfRangeException>(ex);
        }
Beispiel #2
0
        protected void PrintSqList <T>(SqList <T> list) where T : IComparable <T>
        {
            if (list == null)
            {
                return;
            }

            for (int idx = 0; idx < list.Length; idx++)
            {
                _output.WriteLine(list.Find(idx).ToString());
            }
        }