Removed duplicate code in the test mode method/operator declarations

I was looking at adding a wip operator that would work with existing test methods (next PR) and noticed that this could be DRY'd up a bit. 

I know I could push this just wanted to sanity check that you are OK with it.