NUnit - Looking for a comprehensive (RDBMS) example implementation

M

MD

Hello

I work in a .NET environment and I am about to create a development
strategy. As part of this I am looking at implementing a testing tool
to fit in with an iterative approach and NUnit seems to be the logical
choice. Although it works well with very simple classes, it seems to
struggle when you are confronted with anything substantial - eg an
application that accesses/updates an RDBMS.

For instance :-
- how do I test the processing of database operations - a query of any
substance is difficult enough to verify as it requires a test bed of
static data - but an update not only requires a test bed but also a
query to make sure the update was successful - is this the way this is
done - I have read somewhere that NUnit assumes database operations to
be successful - in the real world, this of course can't be assumed so
do I need another tool to test queries (including complex report
queries) and updates.
- how do I test a method that processes say a datatable - do I have to
create a datatable manually then pass this to the method within the
NUnit Assert.

I am looking for simple solutions here - the developers that will
follow this do not have the time to develop numerous complex testing
classes inhereting base classes specially created for the sake of
testing.

Does anyone have examples - say a solution that includes an NUnit
project that tests an RDBMS .NET application.

Many thanks
 
M

Michael Nemtsev

Hello md,

unit testing assumes that u test unit component, not the interation - it's
the integration testing
To test processing of DB operation u need to test
a) stored procedures
b) calling stored procedure
c) component that use SP

separately. Several unit test for each type

When you are writing tests for UI component that use data component with
call of SP u need to Mock this data component
It means that u need know nothing about data component and needn't test in
with your UI component.
See description Mock either in NUnit or use NMock

m> Hello
m>
m> I work in a .NET environment and I am about to create a development
m> strategy. As part of this I am looking at implementing a testing
m> tool to fit in with an iterative approach and NUnit seems to be the
m> logical choice. Although it works well with very simple classes, it
m> seems to struggle when you are confronted with anything substantial -
m> eg an application that accesses/updates an RDBMS.
m>
m> For instance :-
m> - how do I test the processing of database operations - a query of
m> any
m> substance is difficult enough to verify as it requires a test bed of
m> static data - but an update not only requires a test bed but also a
m> query to make sure the update was successful - is this the way this
m> is
m> done - I have read somewhere that NUnit assumes database operations
m> to
m> be successful - in the real world, this of course can't be assumed so
m> do I need another tool to test queries (including complex report
m> queries) and updates.
m> - how do I test a method that processes say a datatable - do I have
m> to
m> create a datatable manually then pass this to the method within the
m> NUnit Assert.
m> I am looking for simple solutions here - the developers that will
m> follow this do not have the time to develop numerous complex testing
m> classes inhereting base classes specially created for the sake of
m> testing.
m>
m> Does anyone have examples - say a solution that includes an NUnit
m> project that tests an RDBMS .NET application.
m>
m> Many thanks
m>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top