-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #701 from Ste1io/Ste1io/separate-dbms-driver-tests
Integration tests refactor to separate DBMS/driver tests
- Loading branch information
Showing
238 changed files
with
2,265 additions
and
1,962 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-dotnettools.csdevkit", | ||
"ms-azuretools.vscode-docker" | ||
] | ||
} |
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
|
||
namespace PetaPoco.Tests.Integration | ||
{ | ||
public abstract class BaseDbContext : IDisposable | ||
{ | ||
private TestProvider _provider; | ||
|
||
protected IDatabase DB { get; set; } | ||
protected string ProviderName { get; private set; } | ||
|
||
protected BaseDbContext(TestProvider provider) | ||
{ | ||
_provider = provider; | ||
DB = _provider.Execute(); | ||
ProviderName = _provider.ProviderName; | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
_provider?.Dispose(); | ||
_provider = null; | ||
DB?.Dispose(); | ||
DB = null; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
PetaPoco.Tests.Integration/Databases/Firebird/FirebirdDatabaseTests.cs
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
PetaPoco.Tests.Integration/Databases/Firebird/FirebirdExecuteTests.cs
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
PetaPoco.Tests.Integration/Databases/Firebird/FirebirdInsertTests.cs
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
PetaPoco.Tests.Integration/Databases/Firebird/FirebirdMiscellaneousTests.cs
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
PetaPoco.Tests.Integration/Databases/Firebird/FirebirdQueryLinqTests.cs
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
PetaPoco.Tests.Integration/Databases/FirebirdTests/FirebirdDatabaseTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using PetaPoco.Tests.Integration.Providers; | ||
using Xunit; | ||
|
||
namespace PetaPoco.Tests.Integration.Databases.Firebird | ||
{ | ||
[Collection("Firebird")] | ||
public class FirebirdDatabaseTests : DatabaseTests | ||
{ | ||
public FirebirdDatabaseTests() | ||
: base(new FirebirdTestProvider()) | ||
{ | ||
} | ||
} | ||
} |
7 changes: 4 additions & 3 deletions
7
...Databases/Firebird/FirebirdDeleteTests.cs → ...ases/FirebirdTests/FirebirdDeleteTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
using PetaPoco.Tests.Integration.Providers; | ||
using Xunit; | ||
|
||
namespace PetaPoco.Tests.Integration.Databases.Firebird | ||
{ | ||
[Collection("Firebird")] | ||
public class FirebirdDeleteTests : BaseDeleteTests | ||
public class FirebirdDeleteTests : DeleteTests | ||
{ | ||
public FirebirdDeleteTests() | ||
: base(new FirebirdDBTestProvider()) | ||
: base(new FirebirdTestProvider()) | ||
{ | ||
} | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
PetaPoco.Tests.Integration/Databases/FirebirdTests/FirebirdExecuteTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using PetaPoco.Tests.Integration.Providers; | ||
using Xunit; | ||
|
||
namespace PetaPoco.Tests.Integration.Databases.Firebird | ||
{ | ||
[Collection("Firebird")] | ||
public class FirebirdExecuteTests : ExecuteTests | ||
{ | ||
public FirebirdExecuteTests() | ||
: base(new FirebirdTestProvider()) | ||
{ | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
PetaPoco.Tests.Integration/Databases/FirebirdTests/FirebirdInsertTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using PetaPoco.Tests.Integration.Providers; | ||
using Xunit; | ||
|
||
namespace PetaPoco.Tests.Integration.Databases.Firebird | ||
{ | ||
[Collection("Firebird")] | ||
public class FirebirdInsertTests : InsertTests | ||
{ | ||
public FirebirdInsertTests() | ||
: base(new FirebirdTestProvider()) | ||
{ | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
PetaPoco.Tests.Integration/Databases/FirebirdTests/FirebirdMiscellaneousTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using PetaPoco.Tests.Integration.Providers; | ||
using Xunit; | ||
|
||
namespace PetaPoco.Tests.Integration.Databases.Firebird | ||
{ | ||
[Collection("Firebird")] | ||
public class FirebirdMiscellaneousTests : MiscellaneousTests | ||
{ | ||
public FirebirdMiscellaneousTests() | ||
: base(new FirebirdTestProvider()) | ||
{ | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
PetaPoco.Tests.Integration/Databases/FirebirdTests/FirebirdPreExecuteTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.Collections.Generic; | ||
using System.Data; | ||
using System.Linq; | ||
using PetaPoco.Tests.Integration.Providers; | ||
using Xunit; | ||
|
||
namespace PetaPoco.Tests.Integration.Databases.Firebird | ||
{ | ||
[Collection("Firebird")] | ||
public class FirebirdPreExecuteTests : PreExecuteTests | ||
{ | ||
protected override IPreExecuteDatabaseProvider Provider => DB.Provider as PreExecuteDatabaseProvider; | ||
|
||
public FirebirdPreExecuteTests() | ||
: base(new PreExecuteTestProvider()) | ||
{ | ||
Provider.ThrowExceptions = true; | ||
} | ||
|
||
protected class PreExecuteTestProvider : FirebirdTestProvider | ||
{ | ||
protected override IDatabase LoadFromConnectionName(string name) | ||
=> BuildFromConnectionName(name).UsingProvider<PreExecuteDatabaseProvider>().Create(); | ||
} | ||
|
||
protected class PreExecuteDatabaseProvider : PetaPoco.Providers.FirebirdDbDatabaseProvider, IPreExecuteDatabaseProvider | ||
{ | ||
public bool ThrowExceptions { get; set; } | ||
public List<IDataParameter> Parameters { get; set; } = new List<IDataParameter>(); | ||
|
||
public override void PreExecute(IDbCommand cmd) | ||
{ | ||
Parameters.Clear(); | ||
|
||
if (ThrowExceptions) | ||
{ | ||
Parameters = cmd.Parameters.Cast<IDataParameter>().ToList(); | ||
throw new PreExecuteException(); | ||
} | ||
} | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
PetaPoco.Tests.Integration/Databases/FirebirdTests/FirebirdQueryLinqTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using PetaPoco.Tests.Integration.Providers; | ||
using Xunit; | ||
|
||
namespace PetaPoco.Tests.Integration.Databases.Firebird | ||
{ | ||
[Collection("Firebird")] | ||
public class FirebirdQueryLinqTests : QueryLinqTests | ||
{ | ||
public FirebirdQueryLinqTests() | ||
: base(new FirebirdTestProvider()) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
...bases/Firebird/FirebirdStoredProcTests.cs → .../FirebirdTests/FirebirdStoredProcTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
using System; | ||
using FirebirdSql.Data.FirebirdClient; | ||
using PetaPoco.Tests.Integration.Providers; | ||
using Xunit; | ||
|
||
namespace PetaPoco.Tests.Integration.Databases.Firebird | ||
{ | ||
[Collection("Firebird")] | ||
public class FirebirdStoredProcTests : BaseStoredProcTests | ||
public class FirebirdStoredProcTests : StoredProcTests | ||
{ | ||
protected override Type DataParameterType => typeof(FbParameter); | ||
|
||
public FirebirdStoredProcTests() | ||
: base(new FirebirdDBTestProvider()) | ||
: base(new FirebirdTestProvider()) | ||
{ | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.