The easiest way to assert that student code produces a specific string is to use an Input / Output test. Using this test type, you can compare the output of student code to a specific string, using either strict match (student code must match specified string exactly) or flexible match (ignores whitespace, case, and newlines). 

Did this answer your question?