|
From: Marcelo de M. S. <cel...@gm...> - 2006-12-29 10:19:59
|
Hi Luke, thanks for the reply :)
It is still not clear to me the role of MovieClip classes on asunit unit
tests. From what I've been reading about Unit Testing so far, I can
understand that visual entities should not be unit tested directly. Instead,
the business classes that are used by it should be tested and I don't think
business classes should inherit MovieClip (am I misunderstanding something
here?).
But let's say I really want to instantiate a MovieClip class on my unit
test. The XUL UI feature you described is for creating mock objects for
MovieClip classes, right? I'm asking this becouse it would be too much of a
stress to try to instantiate a regular "non-serializable" MovieClip class as
it depends on assets that are not present on the test swf library (and
should not be present, I'm almost sure!).
Cheers,
Marcelo.
On 12/29/06, Luke Bayes <lb...@gm...> wrote:
>
> Sorry for the delayed response, been away from the gmail for a bit...
>
> It seems you guys are getting it sorted out, and the only thing I wanted
> to add is that the TestCase class does have a helper method for
> attachMovie... This method gives you the ability to ignore the instance name
> and depth arguments which is critical when building out large test suites.
>
> TestCase does not extend MovieClip, but it delegates responsibility for
> clip creation to the Runner - that does extend MovieClip.
>
> You should be able to see this usage in action using the XUL UI by
> choosing "Make Class Serializable", but for those of you not on that system,
> it's something like this (untested pseudo-code):
>
> public function setUp():Void {
> var initObject:Object = {param1:value1, param2:value2};
> instance = attachMovie(SomeClassName.linkageId, initObject);
> }
>
> public function tearDown():Void {
> instance.removeMovieClip();
> delete instance;
> }
>
> public function testSomeMethod():Void {
> assertEquals("foo", instance.getFooString());
> }
>
>
> Using this utility method will help get rid of massive amounts of
> duplicate code in your test suites, and it has the added benefit of
> automagically overcoming some bugs in the Flash Player that have to do with
> "removed" clips not actually being destroyed synchronously.
>
>
> Good luck,
>
>
> Luke Bayes
> www.asunit.org
>
>
> -------------------------------------------------------------------------
> 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
>
>
>
|