Skip to content
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

Integration tests refactor to separate DBMS/driver tests #701

Merged

Conversation

Ste1io
Copy link
Collaborator

@Ste1io Ste1io commented Oct 7, 2023

Refactors PetaPoco's integration tests to improve maintainability and consistency across the codebase.

  • Restructured driver tests for:
    • SqlServer [System.Data][Microsoft.Data]
    • SQLite [System.Data][Microsoft.Data]
  • Introduced IExceptionDatabaseProvider interface for PreExecuteTests.
  • Updated MSAccess' test runner to programmatically generate PetaPoco.accdb, eliminating the need to tow around an extra build artifact.
  • Fixed filename, namespace, and class naming inconsistencies across integration tests.
  • Clarified Documentation test comments (possible ambiguity with "they are the same" terminology), use Shouldly's ReferenceEqual assertion instead of object.Equals, use Should.NotThrowAsync for .NET Core targets.
  • Updated project dependencies for PetaPoco.Tests.Integration: Shouldly, xUnit, and Newtonsoft.Json.
  • Standardized RDBMS provider file naming.
  • Added .vscode extensions for C# development and Docker support.

Closes #698

- fix naming inconsistencies
- rename poco member to avoid ambiguity with Shouldly method
- replace equality check with Shouldly's ReferenceEqual assertion method to show clearer intent
- rephrase "they are the same" comments to avoid confusion between reference equality and value equality
- BaseDatabase.cs -> BaseDbContext.cs
- DBTestProvider.cs -> BaseDbProviderFactory.cs

- MariaDb -> MariaDb
- MsAccess -> MSAccess
- Mssql -> SqlServer
- MssqlCe -> SqlServerCe
- MssqlMsData -> SqlServerMSData
- Sqlite -> SQLite
revert previous MSAccess data type change
- update namespaces
- update derived Database class names
- update derived DbProviderFactory class names
- Shouldly, xUnit, Newtonsoft.Json

update PetaPoco.csproj nuget tags
minor cleanup of base base context/provider classes
create IExceptionDatabaseProvider.cs
move TestProviders to Providers namespace/dir
- add test project properties
- sort package references
update SqlCe PreExecute Tests for completeness
update SqlServer catalog name in cxn strings
- make SQLiteTestProvider abstract
- create SQLiteSystemDataTestProvider
- create SQLiteMSDataTestProvider
@Ste1io Ste1io requested review from asherber and pleb October 9, 2023 19:12
@Ste1io Ste1io marked this pull request as ready for review October 9, 2023 19:13
@pleb pleb merged commit 53e928c into CollaboratingPlatypus:development Oct 11, 2023
1 check passed
@pleb
Copy link
Member

pleb commented Oct 11, 2023

@Ste1io I didn't go through all the changes, but I trust you, and what I did look at was good... so I hit merge :)

Thanks for all the great work you've been contributing

@Ste1io
Copy link
Collaborator Author

Ste1io commented Oct 11, 2023

Much appreciated, @pleb.

@Ste1io Ste1io added this to the 6.2 milestone Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Integration Tests to separate DBMS tests from driver tests
2 participants