Extracted common unit test method