Tests for read and write.

Tests for the `read` and `write` methods on Resource.