One of the oldest yet still not satisfactorily solved problems of reusing existing software components is the unexpected behaviour of the components in component-based software. The reason is that these components are adequately tested for the present situation, that is, within the context they are supposed to be deployed at the moment, but hardly take into account all potentially possible contexts in which they might be deployed in the future. Thus, we must test a component for the context in which it is being reused. We propose an MDA-based framework to perform context-dependent testing of a component (MD-CDT). In MD-CDT, we model the component's usage, in the component-based software, using use cases and interaction diagrams. The test cases for context-dependent testing of the component are automatically generated from these scenarios using a MDA-based tool. We then evaluate the adequacy of these test cases by comparing them with the test suite that component developer had used to perform component testing at the time of component development which is provided as metadata. This comparison identifies weaknesses of component testing which assist us in devising test cases to test the component's functionality which was not fully tested during component testing. Finally, we test the component for the new context by executing the enriched test suite. This approach is novel in that it uses the test suite, which was executed by component developer, to determine the adequacy of the component testing. Another novelty of this approach is the use of the model-driven technology for performing context-dependent testing of components which makes our framework portable, interoperable and maintainable. We provide a prototype implementation of MD-CDT. We evaluate MD-CDT and the prototype tool on Lucene search engine.