これはバグですか、string.Format
それとも何ですか?
// Act
string l = "This is an UnitTest embedded resource.";
string r = "Please do not remove or change. Sincerely yours, {0}".FormatWith(model.Username);
string expected = "[\r\n\t{0}\r\n\r\n\r\n]\r\n{\r\n\t\r\n\t{1}\r\n\r\n}".FormatWith(l, r);
このFormatWith
メソッドは、シンタックス シュガーの単なる拡張です。
public static string FormatWith(this string text, params object[] args)
{
return string.Format(text, args);
}