public static ClipString ( string s, int maxStringLength, int clipStart ) : string | ||
s | string | The string to be clipped |
maxStringLength | int | The maximum permitted length of the result string |
clipStart | int | The point at which to start clipping |
Résultat | string |
public static void TestClipString(string input, int max, int start, string result) { #if !PORTABLE System.Console.WriteLine("input= \"{0}\"", input); System.Console.WriteLine("result= \"{0}\"", result); #endif Assert.That(MsgUtils.ClipString(input, max, start), Is.EqualTo(result)); }
/// <summary> /// Write the constraint description to a MessageWriter /// </summary> /// <param name="writer">The writer on which the description is displayed</param> public override void WriteDescriptionTo(MessageWriter writer) { writer.WritePredicate("String starting with"); writer.WriteExpectedValue(MsgUtils.ClipString(expected, writer.MaxLineLength - 40, 0)); if (this.caseInsensitive) { writer.WriteModifier("ignoring case"); } }