I'll repeat my question. ;) What is it that you want to assert? Are
you trying to make sure that the data set that comes out of your
method looks like what you want it to? If so, the simplest method
might simply be to assert each attribute that you want to check, one
at a time, and then write code that satisfies each assert, one at a
time.
For instance, if the result you expect is a dataset with three tables,
"TableOne", "TableTwo" and "TableThree", then I might start with that,
e.g. Assert.That(result.Tables.Count, Is.EqualTo(3)), and then move on
to the next attribute, e.g. that the Tables collection contains
"TableOne", and so on, until all is as expected.
/bs
That's part of my point. You've decided that you need both a
DataTable *and* an Equals assertion for DataTables before you get to
the point where you actually use or need either one. Considerably
before that point, in fact. That does not fit in very well with what
I now understand of TDD.
I'll freely admit to the same mistake when I started out. I *knew* my
system was going to need certain things, so I built them, using TDD,
and thought I was doing well. Until the time came when I found out
that what I'd built had little or nor relation to what I ended up
actually needing elsewhere later on, and I had to go back and change
it. Scrapped it and started over, I did, since that turned out to be
the easiest thing to do.
In addition, "Equals" in this case has a multiple potential meanings,
e.g. object reference A equals object reference B (which would be
quite useless for your purposes, or what I can see of them) or all
properties of A equal all properties of B, which is what I suspect you
are trying to get at.
Yes, it would be nice to put together one single DataTable equals
assertion, but I've seen no compelling evidence to this point that you
actually need such a thing, especially not at this early point. There
are a number of tiny little asserts you could do that would eventually
add up to the assertion that one data table is equal to another,
without having to come up with that exact thing right up front.
In My Never Even Close To Humble Opinion, starting small is the best
way to start with TDD, and this is definitely not small.
/bs