[squeak-dev] Re: Subclassing tests Style Question

Jerome Peace peace_the_dreamer at yahoo.com
Mon Jul 21 15:57:56 UTC 2008


[squeak-dev] Subclassing tests Style Question


Would factoring out an AFactory class help both ATests and BTests? 
If so I would go with that.  
It sounds like that would also become useful in the future use of A.

Then the A setup and the B setup would be both be simple things.

Hth,

Yours in curiosity and service, -Jerome Peace

***
>Herbert König herbertkoenig at gmx.net 
>Mon Jul 21 06:05:56 UTC 2008 
>
>Hi,
>
>I have two classes say A and B.
>
>B has a collection of A which is quite complex.
>
>Laziness suggests to make BTests a subclass of ATests so I could reuse
>the (lengthy) setUp of A in A tests. Something like
>
>BTests>>setUp
> super setUp
> ..stick a copy ATests A into BTests B
> super setUp
> ...add a slightly modified copy of ATests A into BTests B
>
>The gut feeling says BTests should not inherit from ATests if
>B does not inherit from A.
>
>But copying all that A setup code from ATests to BTests does not seem
>right either.
>
>Hey that's the first time I think using a Trait might not be that
>bad??
>
>Making a class with the only purpose to return initialised instances
>of A??
>
>Any advice is much appreciated!
>
>
>Thanks,
>
>Herbert 
>
***



      



More information about the Squeak-dev mailing list