Covered getHistoryAsString method with test cases