Why would you use the following?
Microsoft.VisualStudio.TestTools.UnitTesting.Assert.ReplaceNullChars(string input)
I have searched but can't find any cases of anyone really using this. Even MSDN is not helpful. All I can find out about it is:
ReplaceNullChars – Replaces Null characters in a string \0 with \\0
This doesn't sound all that useful to me and I'm suprised it's there in the Assert class.
It’s probably so that you can print a string containing null chars for better diagnostics, since printing a string which contains a null char usually doesn’t result in anything meaningful (it will usually be truncated in the output).
However, a better method would have been Assert.EscapeNonprintableChars
– i.e. replace not only \0
but all non-printable characters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With