Unit tests added and modified for the prepareBamFiles() function

Modification of existing unit tests to validate the message present in the generated errror().
Creation of new unit tests related to the prepareBamFiles() function.