Add tests for generate