-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Integration Tests to separate DBMS tests from driver tests #698
Comments
The least-intrusive refactor requiring minimal structural changes (afaik) is below. An alternative approach would be to move "DriverTests" out into a sibling directory that mirrors "DbmsTests", and move the base tests out next to both of them. Both approaches would still use the same inheritance structure, namely Dbms tests would need to override both constructors that BaseTests offers; otherwise, the inheritance should work fine as-is. Feedback certainly welcome. PetaPoco\PetaPoco.Tests.Integration\.
│ AppSetting.cs
│ appsettings.json
│ PetaPoco.Tests.Integration.csproj
│
├───Databases
│ │ # Base test classes
│ │ DBTestProvider.cs
│ │ BaseDatabase.cs
│ │ BaseDatabaseTests.cs
│ │ BaseExecuteTests.cs
│ │ BaseQueryTests.cs
│ │ ...
│ │
│ ├───MSSql
│ │ │ # MS SQL DBMS tests
│ │ │ MSSqlDbmsDatabaseTests.cs
│ │ │ MSSqlDbmsDBTestProvider.cs
│ │ │ MSSqlDbmsExecuteTests.cs
│ │ │ MSSqlDbmsQueryTests.cs
│ │ │ ...
│ │ │
│ │ ├───SystemData
│ │ │ # MS SQL driver tests for legacy "System.Data.SqlClient"
│ │ │ MSSqlDatabaseTests.cs
│ │ │ MSSqlTestProvider.cs
│ │ │ MSSqlExecuteTests.cs
│ │ │ MSSqlQueryTests.cs
│ │ │ ...
│ │ │
│ │ └───MSData
│ │ # MS SQL driver tests for modern "Microsoft.Data.SqlClient"
│ │ MSSqlMsDataDatabaseTests.cs
│ │ MSSqlMsDataDBTestProvider.cs
│ │ MSSqlMsDataExecuteTests.cs
│ │ MSSqlMsDataQueryTests.cs
│ │ ...
│ │
│ ├───Postgres
│ │ │ # Postgres Dbms tests
│ │ │ PostgresDbmsDatabaseTests.cs
│ │ │ PostgresDbmsDBTestProvider.cs
│ │ │ PostgresDbmsExecuteTests.cs
│ │ │ PostgresDbmsQueryTests.cs
│ │ │ ...
│ │ │
│ │ └───Npgsql
│ │ # Postgres driver tests for "Npgsql"
│ │ PostgresNpgsqlDatabaseTests.cs
│ │ PostgresNpgsqlDBTestProvider.cs
│ │ PostgresNpgsqlExecuteTests.cs
│ │ PostgresNpgsqlQueryTests.cs
│ │ ...
│ │
│ └───...
│
├───Models
│ │ BugInvestigations.cs
│ │ Note.cs
│ │ Order.cs
│ │ Person.cs
│ │ ...
│ │
│ └───MSSql
│ StorePerson.cs
│
└───Scripts
MSSQLBuildDatabase.sql
PostgresBuildDatabase.sql
... |
Currently there is no distinction between DBMS tests and supported drivers/libraries. This creates both ambiguity, and results in duplicate code.
Adding an additional inheritance level for driver tests, which inherit from DBMS tests, would remove the duplicate test code that's DBMS specific, and encapsulate driver-specific tests moving forward.
The text was updated successfully, but these errors were encountered: