Hey Aral,
Thanks for the post - This is actually a great question and I'm glad
to get the opportunity for some clarification. For the sake of the
archive I'm going to give quite a bit more info than I'm sure you
need, So please don't be offended by the detailed response!
Actually, the code that is added to the CUT (Class Under Test) is
simply put there because it fits nicely into our development process.
That code can be removed in either of two ways...
a) Remove it after creating each and every class that doesn't need it.
This is what we do since a vast majority of our classes actually use
it.
b) Remove it from the Templates so that you'll never see it again. The
Templates can be found at:
[MM Configuration]/External Libraries/asunit/ClassTemplate.as (and
TestClassTemplate.as)
You probably shouldn't mess with the "TestClassTemplate" as that is
used to create the TestCase and does require all of it's params.
Just to be clear about those properties though... They do serve a
multitude of puposes:
1) Some classes (as in our framework) may extend MovieClip, but still
not have a representative in the Library of your .fla. In the case of
these classes, you need to call Object.registerClass with a unique
LinkageId (that is prefixed by "__Packages") and a reference to the
constructor.
2) In other cases, you may have a data object that you would like to
serialize into and out of both Shared Object and (I believe) Local
Connections. In this case, you must also call Object.registerClass
with a unique string identifier and a reference to the constructor.
3) Object.registerClass returns a boolean value of true with a
successful registration and we felt that since this really indicated
whether or not this class could be serialized, it seemed like a
reasonable name at the time. On that note, I have heard intelligent
objections to this name and would encourage any interested party to
simply change that static member name (serializable) in their Class
Templates! If there is big enough interest and force out in the
community, we're definitely amenable to changing these things in any
number of ways.
Please let me know if you need any more information and/or have other questions.
Finally, we're very very interested in getting more detailed
documentation, examples, articles, and spreading the word in general,
so please let us know if you or anyone you know is interested in
contributing some work to the cause!
Thanks,
Luke Bayes
www.asunit.com
|