Skip to content

Commit

Permalink
Move to Microsoft.SqlServer.Compact for Contrib tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCraver committed Nov 22, 2015
1 parent fd10fe7 commit 7915f58
Show file tree
Hide file tree
Showing 10 changed files with 2,095 additions and 0 deletions.
55 changes: 55 additions & 0 deletions Dapper.EntityFramework.StrongName/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"authors": [ "Marc Gravell", "Nick Craver" ],
"owners": [ "marc.gravell", "nick.craver" ],
"projectUrl": "https://github.com/StackExchange/dapper-dot-net",
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",
"summary": "Adds support for DbGeography, etc.",
"description": "Extension handlers for entity framework",
"version": "1.34-beta1",
"title": "Dapper entity framework type handlers (with a strong name)",
"tags": [ "orm", "sql", "micro-orm" ],
"copyright": "2015 Stack Exchange, Inc.",
"dependencies": {
"Dapper.StrongName": {
"version": "1.50-*",
"target": "project"
}
},
"compile": [
"../Dapper.EntityFramework/**/*.cs"
],
"compilationOptions": {
"warningsAsErrors": true
},
"frameworks": {
"net40": {
"frameworkAssemblies": {
"System.Configuration": "4.0.0.0",
"System.Data": "4.0.0.0",
"System.Data.Linq": "4.0.0.0",
"System.Xml": "4.0.0.0"
},
"dependencies": {
"EntityFramework": "6.1.3",
"Microsoft.SqlServer.Types": "11.0.2"
}
},
"net45": {
"compilationOptions": {
"keyFile": "../Dapper.snk",
"define": [ "ASYNC" ]
},
"frameworkAssemblies": {
"System.Configuration": "4.0.0.0",
"System.Data": "4.0.0.0",
"System.Data.Linq": "4.0.0.0",
"System.Runtime": "4.0.0.0",
"System.Xml": "4.0.0.0"
},
"dependencies": {
"EntityFramework": "6.1.3",
"Microsoft.SqlServer.Types": "11.0.2"
}
}
}
}
51 changes: 51 additions & 0 deletions Dapper.EntityFramework/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"authors": [ "Marc Gravell", "Nick Craver" ],
"owners": [ "marc.gravell", "nick.craver" ],
"projectUrl": "https://github.com/StackExchange/dapper-dot-net",
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",
"summary": "Adds support for DbGeography, etc.",
"description": "Extension handlers for entity framework",
"version": "1.34-beta1",
"title": "Dapper entity framework type handlers",
"tags": [ "orm", "sql", "micro-orm" ],
"copyright": "2015 Stack Exchange, Inc.",
"dependencies": {
"Dapper": {
"version": "1.50-*",
"target": "project"
}
},
"compilationOptions": {
"warningsAsErrors": true
},
"frameworks": {
"net40": {
"frameworkAssemblies": {
"System.Configuration": "4.0.0.0",
"System.Data": "4.0.0.0",
"System.Data.Linq": "4.0.0.0",
"System.Xml": "4.0.0.0"
},
"dependencies": {
"EntityFramework": "6.1.3",
"Microsoft.SqlServer.Types": "11.0.2"
}
},
"net45": {
"compilationOptions": {
"define": [ "ASYNC" ]
},
"frameworkAssemblies": {
"System.Configuration": "4.0.0.0",
"System.Data": "4.0.0.0",
"System.Data.Linq": "4.0.0.0",
"System.Runtime": "4.0.0.0",
"System.Xml": "4.0.0.0"
},
"dependencies": {
"EntityFramework": "6.1.3",
"Microsoft.SqlServer.Types": "11.0.2"
}
}
}
}
51 changes: 51 additions & 0 deletions Dapper.Rainbow/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"authors": [ "Sam Saffron" ],
"owners": [ "samsaffron" ],
"projectUrl": "https://github.com/StackExchange/dapper-dot-net",
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",
"summary": "A demo is available at https://gist.github.com/1599013",
"description": "Trivial micro-orm implemented on Dapper, provides with CRUD helpers.",
"version": "0.1.3-beta1",
"title": "Dapper.Rainbow",
"tags": [ "orm", "sql", "micro-orm" ],
"copyright": "2012 Sam Saffron",
"dependencies": {
"Dapper": {
"version": "1.50-*",
"target": "project"
}
},
"compile": [
"**/*.cs",
"../Dapper/TypeExtensions.cs"
],
"compilationOptions": {
"warningsAsErrors": true
},
"frameworks": {
"net40": {
"frameworkAssemblies": {
"System.Configuration": "4.0.0.0",
"System.Data": "4.0.0.0",
"System.Data.Linq": "4.0.0.0"
}
},
"net45": {
"compilationOptions": {
"define": [ "ASYNC" ]
},
"frameworkAssemblies": {
"System.Configuration": "4.0.0.0",
"System.Data": "4.0.0.0",
"System.Data.Linq": "4.0.0.0"
}
},
"dotnet5.4": {
"compilationOptions": {
"define": [ "ASYNC", "COREFX" ]
},
"dependencies": {
}
}
}
}
45 changes: 45 additions & 0 deletions Dapper.SqlBuilder/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"authors": [ "Sam Saffron, Johan Danforth" ],
"owners": [ "AEckenberger", "nick.craver" ],
"projectUrl": "https://github.com/StackExchange/dapper-dot-net",
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",
"summary": "Dapper.SqlBuilder",
"description": "The Dapper SqlBuilder component, for building SQL queries dynamically.",
"version": "1.50-beta3",
"title": "Dapper SqlBuilder component",
"tags": [ "orm", "sql", "micro-orm", "query", "sql-builder" ],
"copyright": "2015 Stack Exchange, Inc.",
"dependencies": {
"Dapper": {
"version": "1.50-*",
"target": "project"
}
},
"compilationOptions": {
"warningsAsErrors": true
},
"frameworks": {
"net40": {
"frameworkAssemblies": {
"System.Data": "4.0.0.0",
"System.Data.Linq": "4.0.0.0"
}
},
"net45": {
"compilationOptions": {
"define": [ "ASYNC" ]
},
"frameworkAssemblies": {
"System.Data": "4.0.0.0",
"System.Data.Linq": "4.0.0.0"
}
},
"dotnet5.4": {
"compilationOptions": {
"define": [ "ASYNC", "COREFX" ]
},
"dependencies": {
}
}
}
}
112 changes: 112 additions & 0 deletions Dapper.Tests.Contrib/TestSuites.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
using System;
using System.Data;
using System.Data.SqlClient;
using System.IO;

#if COREFX
using Microsoft.Data.Sqlite;
using IDbConnection = System.Data.Common.DbConnection;
#else
using System.Data.SQLite;
using System.Data.SqlServerCe;
using SqliteConnection = System.Data.SQLite.SQLiteConnection;
#endif

namespace Dapper.Tests.Contrib
{
// The test suites here implement TestSuiteBase so that each provider runs
// the entire set of tests without declarations per method
// If we want to support a new provider, they need only be added here - not in multiple places

public class SqlServerTestSuite : TestSuite
{
const string DbName = "tempdb";
public static string ConnectionString => $"Data Source=.;Initial Catalog={DbName};Integrated Security=True";
public override IDbConnection GetConnection() => new SqlConnection(ConnectionString);

static SqlServerTestSuite()
{
using (var connection = new SqlConnection(ConnectionString))
{
connection.Open();
connection.Execute(@"DROP TABLE Stuff;");
connection.Execute(@"CREATE TABLE Stuff (TheId int IDENTITY(1,1) not null, Name nvarchar(100) not null, Created DateTime null);");
connection.Execute(@"DROP TABLE People;");
connection.Execute(@"CREATE TABLE People (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null);");
connection.Execute(@"DROP TABLE Users;");
connection.Execute(@"CREATE TABLE Users (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null, Age int not null);");
connection.Execute(@"DROP TABLE Automobiles;");
connection.Execute(@"CREATE TABLE Automobiles (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null);");
connection.Execute(@"DROP TABLE Results;");
connection.Execute(@"CREATE TABLE Results (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null, [Order] int not null);");
connection.Execute(@"DROP TABLE ObjectX;");
connection.Execute(@"CREATE TABLE ObjectX (ObjectXId nvarchar(100) not null, Name nvarchar(100) not null);");
connection.Execute(@"DROP TABLE ObjectY;");
connection.Execute(@"CREATE TABLE ObjectY (ObjectYId int not null, Name nvarchar(100) not null);");
}
}
}

#if !COREFX && !DNX451
// This doesn't work on DNX right now due to:
// In Visual Studio: Interop loads (works from console, though)
// In general: parameter names, see https://github.com/StackExchange/dapper-dot-net/issues/375
public class SQLiteTestSuite : TestSuite
{
const string FileName = "Test.DB.sqlite";
public static string ConnectionString => $"Filename={FileName};";
public override IDbConnection GetConnection() => new SqliteConnection(ConnectionString);

static SQLiteTestSuite()
{
if (File.Exists(FileName))
{
File.Delete(FileName);
}
SqliteConnection.CreateFile(FileName);
using (var connection = new SqliteConnection(ConnectionString))
{
connection.Open();
connection.Execute(@"CREATE TABLE Stuff (TheId integer primary key autoincrement not null, Name nvarchar(100) not null, Created DateTime null) ");
connection.Execute(@"CREATE TABLE People (Id integer primary key autoincrement not null, Name nvarchar(100) not null) ");
connection.Execute(@"CREATE TABLE Users (Id integer primary key autoincrement not null, Name nvarchar(100) not null, Age int not null) ");
connection.Execute(@"CREATE TABLE Automobiles (Id integer primary key autoincrement not null, Name nvarchar(100) not null) ");
connection.Execute(@"CREATE TABLE Results (Id integer primary key autoincrement not null, Name nvarchar(100) not null, [Order] int not null) ");
connection.Execute(@"CREATE TABLE ObjectX (ObjectXId nvarchar(100) not null, Name nvarchar(100) not null) ");
connection.Execute(@"CREATE TABLE ObjectY (ObjectYId integer not null, Name nvarchar(100) not null) ");
}
}
}
#endif

#if !COREFX
public class SqlCETestSuite : TestSuite
{
const string FileName = "Test.DB.sdf";
public static string ConnectionString => $"Data Source={FileName};";
public override IDbConnection GetConnection() => new SqlCeConnection(ConnectionString);

static SqlCETestSuite()
{
if (File.Exists(FileName))
{
File.Delete(FileName);
}
var engine = new SqlCeEngine(ConnectionString);
engine.CreateDatabase();
using (var connection = new SqlCeConnection(ConnectionString))
{
connection.Open();
connection.Execute(@"CREATE TABLE Stuff (TheId int IDENTITY(1,1) not null, Name nvarchar(100) not null, Created DateTime null) ");
connection.Execute(@"CREATE TABLE People (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null) ");
connection.Execute(@"CREATE TABLE Users (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null, Age int not null) ");
connection.Execute(@"CREATE TABLE Automobiles (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null) ");
connection.Execute(@"CREATE TABLE Results (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null, [Order] int not null) ");
connection.Execute(@"CREATE TABLE ObjectX (ObjectXId nvarchar(100) not null, Name nvarchar(100) not null) ");
connection.Execute(@"CREATE TABLE ObjectY (ObjectYId int not null, Name nvarchar(100) not null) ");
}
Console.WriteLine("Created database");
}
}
#endif
}
Loading

0 comments on commit 7915f58

Please sign in to comment.