Unit testing the persistence logic