public static void TestHexMethods_Invalid()
{
Assert.Throws<ArgumentException>(() => Uri.FromHex('?'));
Assert.Throws<ArgumentOutOfRangeException>(() => Uri.HexEscape('\x100'));
int index = -1;
Assert.Throws<ArgumentOutOfRangeException>(() => Uri.HexUnescape("%75", ref index));
index = 0;
Uri.HexUnescape("%75", ref index);
Assert.Throws<ArgumentOutOfRangeException>(() => Uri.HexUnescape("%75", ref index));
}
}