Refactor operator tests