I am using C# with .NET Core and Microsoft.VisualStudio.TestTools.UnitTesting.
When calling:
StringAssert.Contains(my_text, my_needle);
with some my_text values, for example:
StringAssert.Contains("foo bar baz", "hello");
a correct error message is displayed :
StringAssert.Contains failed. String 'foo bar baz' does not contain string 'hello'. .
at ...
However, if my_text has other values, the following error occurs:
Test method MyTest threw exception:
System.FormatException: Input string was not in a correct format.
at System.Text.ValueStringBuilder.ThrowFormatError()
at System.Text.ValueStringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at ...
Why is this happening?
Update: I have filed this as a bug report