On Fri, 2006-05-12 at 15:57 +0200, Dean Zobec wrote:
> Joost van der Sluis wrote:
> >>> If I have several tests defined for a component. The component is
> >>> created and destroyed in the setup and teardown procedures. And then one
> >>> test is done.
> >>>
> >>> But now, when all tests are performed. I want to run those tests again,
> >>> but then with one different value for a property of the component.
> >>>
> >>> And then once again, with another property change.
> >>>
> >>> How can I do that in w nice way?
> >> The framework as designed in JUnit has no external input. So, the
> >> simplest way is to write a set of tests in which you use the same setup
> >> and teardown code and assign the value to a property in the body of the
> >> test method.
> >
> > But then, how can I run those tests more then once?
> >
> > Or else I've to add wrappers for all the properties I want to change.
> > for example 10 tests, running with 20 different settings writing =
> > 20*10=200 procedures...
> >
> >> or you could decide to read the property from a text file, but in this
> >> case you should always remember to change this value and repeat the
> >> tests, non practical at all.
> >> Can you send me an example of your tests for which you need this, maybe
> >> a concrete case could give me a better idea.
> >
> > See the attachment in my mail from 11:40 pm. The tests in TestDBBasics.
> > I want to run them all with GetNDataset(x).Packetrecords := -1, 1, 5,
> > 10, 100
> >
> > Btw: what do you think of the tests? Improvements are welcome...
> Didn't have the time to look at your tests yet, but I've written a small
> example on how to effectively write parameterized tests in fpcunit, that
> I'm attaching to this mail.
> It proves once again that the junit framework design is quite flexible
> and can be simply adapted to different testing needs. I added a short
> description and some comments to the code to see how to proceed.
This is great. Thank you.
Joost.
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives