Change unittest from writing output to concatening to an array and checking content