Refactored expressions tests. Refs #18586