Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2006

Tip: Looking for answers? Try searching our database.

Database testing with automated verifications of your modifications ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tomjbr.32022025@bloglines.com - 30 Aug 2006 15:34 GMT
Can anyone recommend a good framework (preferably open source) that can
be used for database testing ?

The thing I want to be able to do is the following:
(1) Define the expected database changes that I want my following code
to trigger
(2) Take a snapshow of the database before my test code starts
(3) Execute my code being tested
(4) Verify that all the changes have been done to the database

In other words, I am looking for a component that can be used in a
similar way as some mock object frameworks where you record the
expected methods that should be invoked by your code, but instead I
want to record the expected database changes that will be triggered by
my code.

To further explain what I mean, here is a code sample of the kind of
feature I would wish:

string connectionString = "...";
DatabaseTester oDatabaseTester = new DatabaseTester(connectionString);
oDatabaseTester.AddExpectation(new RowsInserted("tableName1", 3)); // 3
rows is expected to become inserted to table "tableName1"
oDatabaseTester.AddExpectation(new RowsDeleted("tableName2", 4));// 4
rows is expected to become deleted from table "tableName2"
oDatabaseTester.AddExpectation(new UpdatedRow("tableName3",
"columnName1", "newValue", "123"));
// the value of the column "columnName1" will get the value "newValue"
at the row with the primarykey "123" in the table "tableName3"
oDatabaseTester.MakeSnapShotOfTheDatabase(); // the content of the
database will be stored internally in the DatabaseTester class

// the code that should cause the above changes to the database (for
example NHibernate code or whatever)

oDatabaseTester.VerifyAllExpectationsHaveBeenMetSinceTheSnapshot();

/Tom
Mathieu Cartoixa - 30 Aug 2006 15:52 GMT
tomjbr.32022025@bloglines.com a écrit :
> Can anyone recommend a good framework (preferably open source) that can
> be used for database testing ?
    For Oracle databases, you can use utPLSQL
(http://utplsql.oracledeveloper.nl/), which is a PL/SQL unit testing
framework. You can write ADO .NET code to call the utPLSQL package
functions if you want to drive your tests from .NET (or better, a .NET
unit testing framework, like NUnit).
    But you will have to write specific code to take a snapshot, undo
changes, check for modifications.

    I think have once read about a similar framework for SQL Server, but
you will have to

    I am pretty sure that no framework exist that target as little as 2
databases, every system being so largely different...

    Mathieu Cartoixa

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.