Refactored similar tests and moved them in the base file