Generate proper exception in OrderedDictionary.Insert() for invalid indexes.
authorJonathan Pryor <jonpryor@vt.edu>
Wed, 9 Jun 2010 14:17:36 +0000 (10:17 -0400)
committerJonathan Pryor <jonpryor@vt.edu>
Wed, 9 Jun 2010 14:17:36 +0000 (10:17 -0400)
commit62058bd9de6d617527523bc3ae9fc3f5f57c2f89
tree456627e041f3e42668baa8b0aa51a62218ff6b04
parent6ef2be492e56707bc181017660b8aef6067834be
Generate proper exception in OrderedDictionary.Insert() for invalid indexes.

IList<T>.Insert() is documented as throwing ArgumentOutOfRangeException if the
index is invalid.  However, OrderedDictionary.Insert() was instead throwing an
ArgumentException.  The reason is because OrderedDictionary.Insert() isn't
doing any argument validation, instead relying upon the underlying Dictionary
and List instances, and in some circumstances the Dictionary would throw
ArgumentException before the List could throw ArgumentOutOfRangeException.
src/Cadenza/Cadenza.Collections/OrderedDictionary.cs