Refactor tests a bit to reduce code duplication.

(Still needs more work).

Change-Id: I164c206ab0deb354c3298ee00b6570e9180c4f56
2 files changed