Call all ResourceProviderFactories and reset the providers before tests. Store the provider and/or the error in a fixed factory function to be returned again later.