logo       

Re: Possible FAQ answer (Re: Multiple Test Cases): msg#00190

java.junit.user

Subject: Re: Possible FAQ answer (Re: Multiple Test Cases)

> > 1.Do we need to create a Test-case class for every
> > class we need to test.
>
> No. It is a convention to start with one TestCase class per class under
> test, but it is not necessary.
>
> TestCase classes only provide a way to organize tests, nothing more.
> Generally you will start with one TestCase class per class under test, but
> then you may find that a small group of tests belong together with their
> own
> common test fixture.[1] In this case, you may move those tests to a new
> TestCase object.

Do not forget maintenance: keep tests easy to find.
- myClass -> myClassTest since everybody expect a test class per class
- add a comment in myClassTest.java file to specify where other relevant
tests for this class are located.

There's no rule here just common sense.

-Vladimir

--
Vladimir Bossicard
www.bossicard.com





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise