Refactor tests

Test are refactored to separate functionality and to enable reuse in users of the provider.
Got it. No problem, I would put in a # TODO to that effect (and maybe file a ticket?)