Replaced duplicated test code with parameterized test class.