AddAttachment and refactored tests