Factories¶
The Factory Class¶
Calling a Factory¶
Here we test whether the factory correctly creates the objects and including the correct handling of constructor elements.
First we create a factory that creates instanace of the Klass class:
Now we use the factory to create the instance
and make sure that the correct class was used to create the object:
Since we passed in a couple positional and a keyword argument