Charlie
> --
> You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to nunit-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nunit-discuss?hl=en.
>
>
On Thu, Nov 10, 2011 at 7:46 AM, Andrey Simonov <andr.s...@gmail.com> wrote:
> Hi Charlie,
>
> That would add significant overhead - I'd like to read all the files
> in one place.
Perhaps inheritance could solve that problem for you.
> Is there any way to do this without creating many fixtures?
Well, fixtures are the primary way of organizing tests, so I'm
not sure that's so desirable unless the code you create is
never examined by a person.
> Or is there a way to generate fixtures automatically?
Aren't you already generating one fixture? Perhaps I didn't
really understand what you are doing. Aren't you generating
code for the tests?
Charlie
If that structure is dynamic, then there is little you can do. However,
if the structure does not change, then you can simply code multiple
fixtures, with tests that take data from different sources.
So you might have a Customer fixture, pulling test data from some
particular source or sources, and an Account fixture pulling its data
from other sources.
Put the common code for these fixtures into a base class so that
you don't have to repeat the logic. In fact, it should be easy to
refactor directly from what you have to use of a base class and
then to create separate leaf classes for the tests you want to
select separately.
Charlie