Refactor unit tests to reduce code duplication.

Change-Id: I988d82d24df505f17a8cf53d68ac41e43c1a5b5c
2 files changed