add tests for card functions