Example #1
0
        public void INdexMinPQ_insertResize_NoException()
        {
            var pq = new IndexMinPQ <string>(2);

            System.IndexOutOfRangeException exception = null;
            try
            {
                pq.insert(1, "P");
                pq.insert(2, "Q");
                pq.insert(3, "E");
            }
            catch (System.IndexOutOfRangeException e)
            {
                exception = e;
            }

            Assert.AreEqual(null, exception);
        }
Example #2
0
        protected internal static System.IndexOutOfRangeException WithInvalidOrdinalMessage(ChannelBuffer buffer, sbyte statusOrdinal, System.IndexOutOfRangeException e)
        {
            int maxBytesToPrint = 1024 * 40;

            return(Exceptions.withMessage(e, format("%s | read invalid ordinal %d. First %db of this channel buffer is:%n%s", e.Message, statusOrdinal, maxBytesToPrint, BeginningOfBufferAsHexString(buffer, maxBytesToPrint))));
        }