Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 438
  • Last Modified:

assert.replacenullchars

What is the proper time to use this assertion in a test?

I'm looking for a practical example.

Thanks,

G
0
gswitz
Asked:
gswitz
1 Solution
 
Alan WarrenCommented:
Nulls propagate, so if you return them as part of a string, the entire string will return null.

So you would use it when you want to return a string (maybe to be used as a log entry), as a string that contains nulls, but not have the entire string return null.

You may want to consider Assert.EscapeNonprintableChars, which replaces not only \0 (null) character but all non-printable characters too.

Alan
0
 
gswitzAuthor Commented:
Thanks!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now