Consolidate variable assignment in test