[COTDC] 48 - ClassFactoryForTestCase

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[COTDC] 48 - ClassFactoryForTestCase

laurent laffont
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.
Laurent

Reply | Threaded
Open this post in threaded view
|

Re: [COTDC] 48 - ClassFactoryForTestCase

abergel
-=-=-=-=-=-=-=-=-=
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
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






Reply | Threaded
Open this post in threaded view
|

Re: [COTDC] 48 - ClassFactoryForTestCase

laurent laffont
Thank you Alexandre.

Laurent

On Thu, Apr 14, 2011 at 11:39 PM, Alexandre Bergel <[hidden email]> 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
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.







Reply | Threaded
Open this post in threaded view
|

Re: [COTDC] 48 - ClassFactoryForTestCase

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

Alexandre



Le 15 avr. 2011 à 14:13, laurent laffont <[hidden email]> a écrit :

Thank you Alexandre.

Laurent

On Thu, Apr 14, 2011 at 11:39 PM, Alexandre Bergel <[hidden email]> 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
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.







Reply | Threaded
Open this post in threaded view
|

Re: [COTDC] 48 - ClassFactoryForTestCase

laurent laffont
On Fri, Apr 15, 2011 at 10:11 PM, Alexandre Bergel <[hidden email]> wrote:
Thanks for your effort. Big achievements are realized with a constant and steady effort.

Thanks !

Laurent


 
Alexandre



Le 15 avr. 2011 à 14:13, laurent laffont <[hidden email]> a écrit :

Thank you Alexandre.

Laurent

On Thu, Apr 14, 2011 at 11:39 PM, Alexandre Bergel <[hidden email][hidden email]> 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
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.