Use functions to create generators in tests

@giorgiosironi I create some cards in the backlog for other basic types. We can merge this and move it under the right generator tomorrow.