[Pharo-project] [COTDC] 48 - ClassFactoryForTestCase

laurent laffont laurent.laffont at gmail.com
Fri Apr 15 20:13:34 CEST 2011


Thank you Alexandre.

Laurent

On Thu, Apr 14, 2011 at 11:39 PM, Alexandre Bergel
<alexandre.bergel at me.com>wrote:

> -=-=-=-=-=-=-=-=-=
> The class ClassFactoryForTestCase is useful when classes needs to be
> created during the execution of the test. This avoid polluting your unit
> tests with dummy and mock classes.
> A typical usage of it is:
>
> TestCase subclass: #YourTest
>        instanceVariableNames: 'classFactory'
>
> YourTest>>setUp
>        classFactory := ClassFactoryForTestCase new
>
> YourTest>>tearDown
>        classFactory deleteClasses.
>
> YourTest>>testIsBehavior
>        | cls |
>        cls := classFactory newClass.
>        self assert: cls isBehavior
> -=-=-=-=-=-=-=-=-=
>
> Cheers,
> Alexandre
>
> On 14 Apr 2011, at 16:07, laurent laffont wrote:
>
> > Today:  ClassFactoryForTestCase
> >
> > Come on guys ! Go Go Go !!
> >
> >
> > Comment Of The Day Contest - One Day One Comment
> > Rules:
> > #1: Each day a not commented class is elected. Each day the best comment
> will be integrated with name of the author(s).
> > #2: If you cannot comment it, deprecate it.
> > Results: http://code.google.com/p/pharo/wiki/CommentOfTheDayContest
> >
> > Laurent
> >
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20110415/032b5b9d/attachment.htm>


More information about the Pharo-project mailing list