loris has asked for the wisdom of the Perl Monks concerning the following question:
Hello all,
I want to write a test for method which is going to extract part of an XML file. The input for this is an array of objects which I generate by parsing a CSV file and creating an object for each line.
My problem is that I am daunted by the setting up the intial conditions for the test. Either I would have to rely on other code (for which, shame on me, I haven't written tests), or generate the objects "by hand". I don't really want to do the later as I need 15 parameters per input object and 4 or 5 objects. Should I be using TestMock::Object, or something similar? I did have a look at some articles about TestMock::Object, but they made my little acolyte brain hurt. OK, no strain, no gain, but I'd like to know whether I'm on the right track first.
Thanks,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Testing with non-trivial input
by kappa (Chaplain) on Nov 25, 2004 at 12:16 UTC | |
|
Re: Testing with non-trivial input
by fglock (Vicar) on Nov 25, 2004 at 12:21 UTC | |
by kappa (Chaplain) on Nov 25, 2004 at 13:15 UTC | |
|
Re: Testing with non-trivial input
by stvn (Monsignor) on Nov 25, 2004 at 16:47 UTC | |
|
Re: Testing with non-trivial input
by Ytrew (Pilgrim) on Nov 25, 2004 at 17:58 UTC | |
|
Re: Testing with non-trivial input
by dws (Chancellor) on Nov 25, 2004 at 17:50 UTC | |
by loris (Hermit) on Oct 12, 2005 at 09:35 UTC | |
by dws (Chancellor) on Oct 12, 2005 at 18:11 UTC |