Could we change the Init() structure to accommodate running different SQL scripts depending on the database being tested? 

 

I’ve resorted to separating out the various Oracle statements into their own SQL files and modifying the Init() methods of the current tests.  I briefly toyed with the idea of using EXECUTE IMMEDIATE and reworking the ScriptRunner to use an Oracle package with ref cursors to run the DDL statements in one script/command text but quickly got over it!

 

Anyway, I think the project may already have been headed in this direction given the MSSQL tests in their own namespace.

 

For example:

 

Make NUnit.SqlMapTests.StatementTest abstract.  Create an NUnit.SqlMapTests.Oracle namespace (like the existing MSSQL namespace).  And create an NUnit.SqlMapTests.Oracle.StatementTest with a different Init().

 

Additionally, we can tag the specific db tests by NUnit Category such as [Category(“MSSQL”)], [Category(“MySQL”)], and [Category(“Oracle”)] or use some other convention.

 

Roberto

 

Reply via email to