Strings are pervasive in computer programming. Whether joining names or generating or parsing XML documents, strings are a fundamental representation for much of the world’s data, which leaves us with the task of verifying string data in our tests.
In this chapter, we examine several ways to verify strings in our tests. We start with the easiest and weakest approaches and increase the strength of our verification with little increase in the complexity of our approach. In the end, we have an approach that gives us strict verification yet is resilient to code changes and friendly to localization strategies.