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