public static void LastIndexOfAny_Invalid()
{
// AnyOf is null
Assert.Throws<ArgumentNullException>(() => "foo".LastIndexOfAny(null));
Assert.Throws<ArgumentNullException>(() => "foo".LastIndexOfAny(null, 0));
Assert.Throws<ArgumentNullException>(() => "foo".LastIndexOfAny(null, 0, 0));
// Start index < 0
Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => "foo".LastIndexOfAny(new char[] { 'o' }, -1));
Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => "foo".LastIndexOfAny(new char[] { 'o' }, -1, 0));
// Start index > string.Length
Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => "foo".LastIndexOfAny(new char[] { 'o' }, 4));
Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => "foo".LastIndexOfAny(new char[] { 'o' }, 4, 0));
// Count < 0 or count > string.Length
Assert.Throws<ArgumentOutOfRangeException>("count", () => "foo".LastIndexOfAny(new char[] { 'o' }, 0, -1));
Assert.Throws<ArgumentOutOfRangeException>("count", () => "foo".LastIndexOfAny(new char[] { 'o' }, 0, 4));
// Start index + count > string.Length
Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => "foo".LastIndexOfAny(new char[] { 'o' }, 3, 1));
}