[Pharo-project] [COTDC] 48 - ClassFactoryForTestCase

Alexandre Bergel alexandre.bergel at me.com
Fri Apr 15 22:11:41 CEST 2011


Thanks for your effort. Big achievements are realized with a constant and steady effort.

Alexandre



Le 15 avr. 2011 à 14:13, laurent laffont <laurent.laffont at gmail.com> a écrit :

> 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/a3031f17/attachment.htm>


More information about the Pharo-project mailing list