|
From: Marcelo de M. S. <cel...@gm...> - 2006-12-27 19:36:26
|
Hi David, thanks a lot for the reply.
There are a few points that I'd like to clarify:
* If I will be attaching the MovieClip "someClass", it will have to be
present on the swf's library. Currently my test swf is only an empty swf;
I see I would have to create this swf using swfmill (or the Flash IDE) and
then add a clip to the library, right?
* Do you think this approach of attaching MovieClip is ok? Doesn't
test-driven design enourage to separate the view from the business logic?
Thanks!
Marcelo.
On 12/27/06, David Ham <em...@da...> wrote:
>
> Marcelo,
>
> I think you have two options. First, I think you are OK in creating an
> instance of your class on the test swf, but I have had better luck in
> creating an empty movieclip and then attaching my new class to that. Then,
> you create an instance of the class you are testing via an attachMovie()
> on
> the test clip, and cast it as a type of the class you are testing.
>
> private var testClip:MovieClip;
> private var instance:myClass
>
> function setUp():Void {
> testClip = _root.createEmptyMovieClip( "testClip", 100 );
> instance = myClass( testClip.attachMovie("someClass", "someClass_mc",
> 0)
> );
> }
>
>
> You can also use createClassObject() if your class extends UIObject.
>
> Be sure you properly remove all the clips in tearDown() that you created
> in
> setUp() or they will clutter up your test SWF.
>
> Hope this helps,
>
> OK
> DAH
>
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Asunit-users mailing list
> Asu...@li...
> https://lists.sourceforge.net/lists/listinfo/asunit-users
>
|