Skip to content
Permalink
Browse files

Refactor

  • Loading branch information...
asherber committed May 15, 2019
1 parent fe0ec24 commit c15921021b95d8e23ab8aa0259aa37adcf83cec1
@@ -11,9 +11,11 @@ namespace PetaPoco.Tests.Integration.Databases
{
public abstract class DBTestProvider : IDisposable
{
public abstract string ProviderName { get; }
protected abstract string ConnectionName { get; }

protected abstract IDatabase Database { get; }
public string ProviderName => GetProviderName(ConnectionName);

protected IDatabase Database => LoadFromConnectionName(ConnectionName);

protected abstract string ScriptResourceName { get; }

@@ -7,11 +7,7 @@ namespace PetaPoco.Tests.Integration.Databases.Firebird
{
public class FirebirdDBTestProvider : DBTestProvider
{
private string _connectionName = "Firebird";

protected override IDatabase Database => LoadFromConnectionName(_connectionName);

public override string ProviderName => GetProviderName(_connectionName);
protected override string ConnectionName => "Firebird";

protected override string ScriptResourceName => "PetaPoco.Tests.Integration.Scripts.FirebirdDbBuildDatabase.sql";

@@ -5,11 +5,7 @@ namespace PetaPoco.Tests.Integration.Databases.MSAccess
{
public class MsAccessDBTestProvider : DBTestProvider
{
private string _connectionName = "msaccess";

protected override IDatabase Database => LoadFromConnectionName(_connectionName);

public override string ProviderName => GetProviderName(_connectionName);
protected override string ConnectionName => "msaccess";

protected override string ScriptResourceName => "PetaPoco.Tests.Integration.Scripts.MSAccessBuildDatabase.sql";

@@ -6,13 +6,10 @@ namespace PetaPoco.Tests.Integration.Databases.MSSQL
public class MssqlDBTestProvider : DBTestProvider
{
private string _connectionName = "mssql";

protected override IDatabase Database => LoadFromConnectionName(_connectionName);
protected override string ConnectionName => _connectionName;

protected override string ScriptResourceName => "PetaPoco.Tests.Integration.Scripts.MSSQLBuildDatabase.sql";

public override string ProviderName => GetProviderName("mssql");

public override IDatabase Execute()
{
EnsureDatabaseExists();
@@ -8,11 +8,7 @@ namespace PetaPoco.Tests.Integration.Databases.MSSQLCe
{
public class MssqlCeDBTestProvider : DBTestProvider
{
private string _connectionName = "mssqlce";

protected override IDatabase Database => LoadFromConnectionName(_connectionName);

public override string ProviderName => GetProviderName(_connectionName);
protected override string ConnectionName => "mssqlce";

protected override string ScriptResourceName => "PetaPoco.Tests.Integration.Scripts.MSSQLCeBuildDatabase.sql";

@@ -2,12 +2,8 @@ namespace PetaPoco.Tests.Integration.Databases.MariaDb
{
public class MariaDbDBTestProvider : DBTestProvider
{
private string _connectionName = "MariaDb";

protected override IDatabase Database => LoadFromConnectionName(_connectionName);
protected override string ConnectionName => "MariaDb";

protected override string ScriptResourceName => "PetaPoco.Tests.Integration.Scripts.MariaDbBuildDatabase.sql";

public override string ProviderName => GetProviderName(_connectionName);
}
}
@@ -2,11 +2,7 @@ namespace PetaPoco.Tests.Integration.Databases.MySQL
{
public class MySqlDBTestProvider : DBTestProvider
{
private string _connectionName = "MySQL";

protected override IDatabase Database => LoadFromConnectionName(_connectionName);

public override string ProviderName => GetProviderName(_connectionName);
protected override string ConnectionName => "MySQL";

protected override string ScriptResourceName => "PetaPoco.Tests.Integration.Scripts.MySqlBuildDatabase.sql";
}
@@ -2,11 +2,7 @@ namespace PetaPoco.Tests.Integration.Databases.Postgres
{
public class PostgresDBTestProvider : DBTestProvider
{
private string _connectionName = "Postgres";

protected override IDatabase Database => LoadFromConnectionName(_connectionName);

public override string ProviderName => GetProviderName(_connectionName);
protected override string ConnectionName => "Postgres";

protected override string ScriptResourceName => "PetaPoco.Tests.Integration.Scripts.PostgresBuildDatabase.sql";
}
@@ -5,10 +5,7 @@ namespace PetaPoco.Tests.Integration.Databases.Sqlite
{
public class SqliteDBTestProvider : DBTestProvider
{
private string _connectionName = "sqlite";
protected override IDatabase Database => LoadFromConnectionName(_connectionName);

public override string ProviderName => GetProviderName(_connectionName);
protected override string ConnectionName => "sqlite";

protected override string ScriptResourceName => "PetaPoco.Tests.Integration.Scripts.SqliteBuildDatabase.sql";

0 comments on commit c159210

Please sign in to comment.
You can’t perform that action at this time.