Refactoring of several unit tests so that the sources files defining the test objects do not contain definitions for other entities

This avoids potential issues when expanding test files that contain other objects besides the test objects. In some rare cases, the expansion of these non-test objects can interfere with the test results.