Forum Discussion
tristaanogre
13 years agoEsteemed Contributor
Sorry, there's no way to do this. Best suggestion would be to use BOTH units but then use that kind of logic in your actual code execution and specify using UnitName.ProcedureName in order to distinguish between the two implementations.
To be honest, if the code units are that closely related, I actually question whether or not this is a "good practice" or if you should, within a single unit, make distinctions within the procedures themselves to detect or make modifications.
The other way to do it is to create a "wrapper" unit that uses the two units you have that receives that option and just, depending upon the option, calls the different procedures. That way, in your actual test code, you only need one "uses" clause but your middle-unit takes care of making the distinction.
To be honest, if the code units are that closely related, I actually question whether or not this is a "good practice" or if you should, within a single unit, make distinctions within the procedures themselves to detect or make modifications.
The other way to do it is to create a "wrapper" unit that uses the two units you have that receives that option and just, depending upon the option, calls the different procedures. That way, in your actual test code, you only need one "uses" clause but your middle-unit takes care of making the distinction.
Related Content
- 3 years agodhundley
- 10 months agoaafreen_jamadar