TestSuite

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

TestSuite

Fernando Rodriguez
Hi,

I already created all my test cases, but I'm not sure how to proceed
form now. I already created an instance of TestSuite and added all the
test cases, but where am I suposed to save this and how do I use it
from the SUnit browser?

Thanks


Reply | Threaded
Open this post in threaded view
|

Re: TestSuite

Schwab,Wilhelm K
Fernando,

> I already created all my test cases, but I'm not sure how to proceed
> form now. I already created an instance of TestSuite and added all the
> test cases, but where am I suposed to save this and how do I use it
> from the SUnit browser?

If you name your test case methods starting with test (e.g. #testThis,
#testThat, #testSomethingElse, etc.) then the SUnitBrowser will make
test suites for you.  You can run the browser from the tools menu, or
right click on a TestCase subclass and look for tests.
<shamelessPlug>My filtered browser goodie will create test cases; see
the run icons which launch the SUnitBrowser on an appropriate test
suite.</shamelessPlug>

I also recommend adding the method below.  As you add new tests, you can
include a comment such as

"
    MyTestCase prod:testSomething.
"

and evaluate it to run the test.  If all goes well, nothing happens; if
the test fails, a walkback appears.  IMHO, this is the easiest way to go
when it is reasonable to expect failures.  The SUnitBrowser is great
when you think most tests should pass or want to know where to spend
some time fixing stuff.  There are many entry points to the SUnit
framework, so please take the time to ensure that anything that you
require (testup, teardown, etc.) is happening.

Have a good one,

Bill



!TestCase class methodsFor!

prod:aSymbol
     "Run the test; do nothing if ok or go to a walkback."

     #wksSafe.
     ( self selector:aSymbol ) runCase.
! !
!TestCase class categoriesFor: #prod:!public! !


--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: TestSuite

Fernando Rodriguez
On Wed, 15 Jun 2005 15:13:31 GMT, Bill Schwab <[hidden email]>
wrote:

>Fernando,
>
>> I already created all my test cases, but I'm not sure how to proceed
>> form now. I already created an instance of TestSuite and added all the
>> test cases, but where am I suposed to save this and how do I use it
>> from the SUnit browser?
>
>If you name your test case methods starting with test (e.g. #testThis,
>#testThat, #testSomethingElse, etc.) then the SUnitBrowser will make
>test suites for you.  

I have a UrlTests class which is a direct subclass of TestCase. I also
have other classes which are subclasses of UrlTests that perform more
specific tests.

The SUnit Browser only creates test suites for the immediate subclass
of TestCase, bot not for the rest.  

Is this the expected behavior?  How do I 'fix' this?

Thansk


Reply | Threaded
Open this post in threaded view
|

Re: TestSuite

Fernando Rodriguez
On Thu, 16 Jun 2005 12:03:28 +0200, Fernando Rodriguez
<[hidden email]> wrote:

Forget it, I just solved it.

>On Wed, 15 Jun 2005 15:13:31 GMT, Bill Schwab <[hidden email]>
>wrote:
>
>>Fernando,
>>
>>> I already created all my test cases, but I'm not sure how to proceed
>>> form now. I already created an instance of TestSuite and added all the
>>> test cases, but where am I suposed to save this and how do I use it
>>> from the SUnit browser?
>>
>>If you name your test case methods starting with test (e.g. #testThis,
>>#testThat, #testSomethingElse, etc.) then the SUnitBrowser will make
>>test suites for you.  
>
>I have a UrlTests class which is a direct subclass of TestCase. I also
>have other classes which are subclasses of UrlTests that perform more
>specific tests.
>
>The SUnit Browser only creates test suites for the immediate subclass
>of TestCase, bot not for the rest.  
>
>Is this the expected behavior?  How do I 'fix' this?
>
>Thansk