DRY up the unittest.