public static void Replace_Char(string value, char oldChar, char newChar, int startIndex, int count, string expected)
{
StringBuilder builder;
if (startIndex == 0 && count == value.Length)
{
// Use Replace(char, char)
builder = new StringBuilder(value);
builder.Replace(oldChar, newChar);
Assert.Equal(expected, builder.ToString());
}
// Use Replace(char, char, int, int)
builder = new StringBuilder(value);
builder.Replace(oldChar, newChar, startIndex, count);
Assert.Equal(expected, builder.ToString());
}