Added UnitTest method to test printing

added a method to test printing, added a helper class to get console
output within a unit test