473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to unit test a Dataset?

Hi.

I have written unit tests for my helper classes that return simple
values as strings or integers. Now I need to test the methods that
deal with DataSets and DataTables. Is there any special issues when
running these kind of tests? I ask this because if I create a DataSet
from scratch reproducing the desired structure and compare this to the
real DataSet I got from running my helper class, the Assert.AreEqual
method says me they are not equal! But both DataSets have the same
tables, columns and number of records.

Any help would be greatly appreciated !

Regards,
RBScheer
Jul 13 '08 #1
1 2326
On Jul 13, 3:04*pm, RBScheer <rbsch...@my-deja.comwrote:
Hi.

I have written unit tests for my helper classes that return simple
values as strings or integers. Now I need to test the methods that
deal with DataSets and DataTables. Is there any special issues when
running these kind of tests? I ask this because if I create a DataSet
from scratch reproducing the desired structure and compare this to the
real DataSet I got from running my helper class, the Assert.AreEqual
method says me they are not equal! But both DataSets have the same
tables, columns and number of records.

Any help would be greatly appreciated !

Regards,
RBScheer
That's a really good question, and not one that I really know an
answer for. If it were me, I'd test as much functionality as you can,
say making sure that you have rows, or a certain number of rows, and
that you have the appropriate columns. You could even spot check the
values of a few of the data rows if you like. The other option would
be to loop through the actual dataset members and compare them with
the expected dataset using Assert.IsTrue(...). That way if any of the
members don't match, the Assert.IsTrue would fail. To be honest, I'm
not sure if I like either method, but at least some coverage is better
than no coverage.

And just to be a pain, why is you are writing your tests after the
code? IMO, you should be doing it the other way around :-)

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Jul 13 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: | last post by:
Hi! I'm looking for unit-testing tools for .NET. Somthing like Java has --> http://www.junit.org regards, gicio
6
by: Ben Finney | last post by:
Howdy all, Summary: I'm looking for idioms in unit tests for factoring out repetitive iteration over test data. I explain my current practice, and why it's unsatisfactory. When following...
72
by: Jacob | last post by:
I have compiled a set og unit testing recommendations based on my own experience on the concept. Feedback and suggestions for improvements are appreciated: ...
6
by: Dick | last post by:
I’d appreciate some advice regarding unit tests. My questions are general in nature but (as usual) best conveyed via a (simplified) example: I have a table that contains two columns – the...
5
by: shuisheng | last post by:
Dear All, I was told that unit test is a powerful tool for progamming. If I am writing a GUI code, is it possible to still using unit test? I have a little experience in using unittest++. But...
1
by: rich_sposato | last post by:
I released version 2.0 of C++ Unit Test Library. You can download it from SourceForget.Net at http://sourceforge.net/projects/cppunittest/ .. I wrote this unit test library because other unit...
6
by: Vyacheslav Maslov | last post by:
Hi all! I have many many many python unit test, which are used for testing some remote web service. The most important issue here is logging of test execution process and result. I strongly...
27
by: brad | last post by:
Does anyone else feel that unittesting is too much work? Not in general, just the official unittest module for small to medium sized projects? It seems easier to write some quick methods that are...
5
by: Ben Finney | last post by:
Howdy all, PEP 299 <URL:http://www.python.org/dev/peps/pep-0299details an enhancement for entry points to Python programs: a module attribute (named '__main__') that will be automatically called...
1
by: RBScheer | last post by:
Hi. I have written unit tests for my helper classes that return simple values as strings or integers. Now I need to test the methods that deal with DataSets and DataTables. Is there any special...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.