public static void Substring(string s, int startIndex, int length, string expected) { if (startIndex + length == s.Length) { Assert.Equal(expected, s.Substring(startIndex)); } Assert.Equal(expected, s.Substring(startIndex, length)); }