-
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 #706 from Curlack/feature/oracle-support
Merging changes from private feature branch to collaboratively address known failing integration tests. See #699 (comment) for details.
- Loading branch information
Showing
13 changed files
with
384 additions
and
17 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
14 changes: 14 additions & 0 deletions
14
PetaPoco.Tests.Integration/Databases/OracleTests/OracleDeleteTests.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.Oracle | ||
{ | ||
[Collection("Oracle")] | ||
public class OracleDeleteTests : DeleteTests | ||
{ | ||
public OracleDeleteTests() | ||
: base(new OracleTestProvider()) | ||
{ | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
PetaPoco.Tests.Integration/Databases/OracleTests/OracleExecuteTests.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.Oracle | ||
{ | ||
[Collection("Oracle")] | ||
public class OracleExecuteTests : ExecuteTests | ||
{ | ||
public OracleExecuteTests() | ||
: base(new OracleTestProvider()) | ||
{ | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
PetaPoco.Tests.Integration/Databases/OracleTests/OracleInsertTests.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,16 @@ | ||
using PetaPoco.Tests.Integration.Models.Postgres; | ||
using PetaPoco.Tests.Integration.Providers; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace PetaPoco.Tests.Integration.Databases.Oracle | ||
{ | ||
[Collection("Oracle")] | ||
public class OracleInsertTests : InsertTests | ||
{ | ||
public OracleInsertTests() | ||
: base(new OracleTestProvider()) | ||
{ | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
PetaPoco.Tests.Integration/Databases/OracleTests/OracleMiscellaneousTests.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.Oracle | ||
{ | ||
[Collection("Oracle")] | ||
public class OracleMiscellaneousTests : MiscellaneousTests | ||
{ | ||
public OracleMiscellaneousTests() | ||
: base(new OracleTestProvider()) | ||
{ | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
PetaPoco.Tests.Integration/Databases/OracleTests/OraclePreExecuteTests.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.Oracle | ||
{ | ||
[Collection("Oracle")] | ||
public class OraclePreExecuteTests : PreExecuteTests | ||
{ | ||
protected override IPreExecuteDatabaseProvider Provider => DB.Provider as PreExecuteDatabaseProvider; | ||
|
||
public OraclePreExecuteTests() | ||
: base(new PreExecuteTestProvider()) | ||
{ | ||
Provider.ThrowExceptions = true; | ||
} | ||
|
||
protected class PreExecuteTestProvider : OracleTestProvider | ||
{ | ||
protected override IDatabase LoadFromConnectionName(string name) | ||
=> BuildFromConnectionName(name).UsingProvider<PreExecuteDatabaseProvider>().Create(); | ||
} | ||
|
||
protected class PreExecuteDatabaseProvider : PetaPoco.Providers.OracleDatabaseProvider, 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/OracleTests/OracleQueryLinqTests.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.Oracle | ||
{ | ||
[Collection("Oracle")] | ||
public class OracleQueryLinqTests : QueryLinqTests | ||
{ | ||
public OracleQueryLinqTests() | ||
: base(new OracleTestProvider()) | ||
{ | ||
} | ||
} | ||
} |
Oops, something went wrong.