Refactored tests to be less stupidly repetitive.