Unit test resource classes instead of hitting the API

On my machine, tests now take 10 seconds instead of 70.

r? @metcalf @wangjohn