3

I am using the TFS API 2010 to insert several error messages into a ITestActionResult. If I do this with the TestRunner (Add Comment) and read the field (ErrorMessage) with the API the string looks like this: "Line1\r\nLine1\r\n"...

If I set the ErrorMessage with TFS API like this: actionResult.ErrorMessage = "Line1\r\nLine2\r\n", the "\r\n" sequence will be ignored! I also try the Environment.NewLine Variable, here the "\r\n" sequence will be treated as a string and not as a escape sequence.

How can I add new lines into ITestActionResult.ErrorMessage similar if I use the TestRunner and push return in a correct way?

KMoraz
  • 14,004
  • 3
  • 49
  • 82
Stel Zy
  • 31
  • 1

1 Answers1

0

Have you tried to split the line into an array. If the type is an array you cannot use a single string.