Writing a generic snapshot test