Title


Is it possible to easy encapsulate units.

I have the unit TestFrameWork that has TTestCase from the DUnit framework, now I want to create an derived class of the TTestCase TMyTestCase to add some base functionality.
This means that al the users of the framework will have to include unit TestFrameWork and MyTestFrameWork because the TestFramework unit still has other functions and classes.
Can I somehow prevent this so the Users of the framework only have to include MyTestFrameWork and have the entire functionality of the TestFramework.

Comments

  1. I don't understand what you are doing, sorry.

    ReplyDelete
  2. DUnit supports decorators for this kind of thing. I don't have the link at the moment but there are some examples of using a test decorator for setting up a db connections that persist for the life of the TTestcase instance or even the entire test suite if you set it up properly.

    It's important to note that this is no longer unit testing but from the sound of it you already know that.

    ReplyDelete
  3. Kenneth Cochran Thanks for the reply. Decorating the entire thing is a bit to much work, I will go for the  mentioning both the units thing.

    ReplyDelete

Post a Comment