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.

IMO the safer way to do this is to create your 4-5 objects by hand. This way you are sure your test input is correctly formed. I assume these 4-5 objects are instances of already written classes, and the 15 parameters they need are all plain perl data types and not objects themselves. If that is the case then I think you will find the quickest way (and again IMO the safest way) to do this will be to do it by hand. Any other code you write to create these object will need to be tested (more testing time), or using Test::MockObject (more learning time).

Also I am not sure Test::MockObject is what you are looking for. Test::MockObject can be used to 'fake' an instance of a complex or resource intensive object which would require too much set-up or management code to have for real.

-stvn

In reply to Re: Testing with non-trivial input by stvn
in thread Testing with non-trivial input by loris

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.