Commit a4bb66de authored by Marc Gravell's avatar Marc Gravell

Test cleanup; enable lots more tests hidden previously as EXTERNALS

parent 19afe1ed
#if EXTERNALS
#if ENTITY_FRAMEWORK
using System.Data.Common;
using System.Data.Entity;
......
#if EXTERNALS
#if NHIBERNATE
using NHibernate;
using NHibernate.Cfg;
......
This diff is collapsed.
......@@ -2,13 +2,15 @@
namespace Dapper.Tests
{
#if EXTERNALS
#if ORMLITE
[ServiceStack.DataAnnotations.Alias("Posts")]
[Soma.Core.Table(Name = "Posts")]
#endif
#if SOMA
[Soma.Core.Table(Name = "Posts")]
#endif
public class Post
{
#if EXTERNALS
#if SOMA
[Soma.Core.Id(Soma.Core.IdKind.Identity)]
#endif
public int Id { get; set; }
......
......@@ -192,7 +192,7 @@ public async Task TestMultiClosedConnAsyncViaFirstOrDefault()
}
}
#if EXTERNALS
#if !COREFX
[Fact]
public async Task ExecuteReaderOpenAsync()
{
......
......@@ -114,7 +114,7 @@ public bool GetWentThroughProperConstructor()
}
}
#if EXTERNALS
#if LINQ2SQL
class NoDefaultConstructorWithBinary
{
public System.Data.Linq.Binary Value { get; set; }
......
......@@ -9,7 +9,7 @@
using System.Linq;
using Xunit;
#if EXTERNALS
#if ENTITY_FRAMEWORK
using System.Data.Entity.Spatial;
using Microsoft.SqlServer.Types;
#endif
......@@ -114,7 +114,7 @@ public void AddParameter(IDbCommand command, string name)
}
#if EXTERNALS
#if !COREFX
[Fact]
public void TestTVPWithAnonymousObject()
{
......@@ -346,7 +346,9 @@ public void DataTableParametersWithExtendedProperty()
ex.Message.Equals("The table type parameter 'ids' must have a valid type name.");
}
}
#endif
#if !COREFX
[Fact]
public void SupportInit()
{
......@@ -354,7 +356,9 @@ public void SupportInit()
obj.Value.Equals("abc");
obj.Flags.Equals(31);
}
#endif
#if ENTITY_FRAMEWORK
class HazGeo
{
public int Id { get; set; }
......@@ -444,7 +448,11 @@ public class HazSqlHierarchy
public int Id { get; set; }
public SqlHierarchyId Path { get; set; }
}
#endif
#if OLEDB
// see http://stackoverflow.com/q/18847510/23354
[Fact]
public void TestOleDbParameters()
......
......@@ -26,16 +26,20 @@
using System.Diagnostics;
using Xunit;
using System.Data.Common;
#if EXTERNALS
#if FIREBIRD
using FirebirdSql.Data.FirebirdClient;
#endif
#if ENTITY_FRAMEWORK
using System.Data.Entity.Spatial;
using Microsoft.SqlServer.Types;
#endif
#if SQL_CE
using System.Data.SqlServerCe;
#endif
using SqlServerTypes;
#if POSTGRESQL
using Npgsql;
#endif
#endif
#if COREFX
namespace System.ComponentModel {
......@@ -116,10 +120,16 @@ static TestSuite()
#endif
Console.WriteLine("Dapper: " + typeof(SqlMapper).AssemblyQualifiedName);
Console.WriteLine("Using Connectionstring: {0}", ConnectionString);
#if EXTERNALS && !DNX
#if !COREFX
Console.Write("Loading native assemblies for SQL types...");
Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);
Console.WriteLine("done.");
try {
Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);
Console.WriteLine("done.");
} catch(Exception ex)
{
Console.WriteLine("failed.");
Console.Error.WriteLine(ex.Message);
}
#endif
}
......@@ -726,7 +736,7 @@ public void TestInheritance()
list.First().Base2.IsEqualTo("Four");
}
#if EXTERNALS
#if !COREFX
[Fact]
public void ExecuteReader()
{
......@@ -739,7 +749,9 @@ public void ExecuteReader()
((int)dt.Rows[0][0]).IsEqualTo(3);
((int)dt.Rows[0][1]).IsEqualTo(4);
}
#endif
#if SQL_CE
[Fact]
public void MultiRSSqlCE()
{
......@@ -784,7 +796,8 @@ public class AuthorCE
public int ID { get; set; }
public string Name { get; set; }
}
#endif
#if LINQ2SQL
[Fact]
public void TestLinqBinaryToClass()
{
......@@ -2226,7 +2239,7 @@ public void SO24605346_ProcsAndStrings()
class PracticeRebateOrders
{
public string fTaxInvoiceNumber;
#if EXTERNALS
#if !COREFX
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
#endif
public string TaxInvoiceNumber { get { return fTaxInvoiceNumber; } set { fTaxInvoiceNumber = value; } }
......@@ -2385,7 +2398,7 @@ public void Issue22_ExecuteScalar()
int? k = connection.ExecuteScalar<int?>("select @i", new { i = default(int?) });
k.IsNull();
#if EXTERNALS
#if ENTITY_FRAMEWORK
Dapper.EntityFramework.Handlers.Register();
var geo = DbGeography.LineFromText("LINESTRING(-122.360 47.656, -122.343 47.656 )", 4326);
var geo2 = connection.ExecuteScalar<DbGeography>("select @geo", new { geo });
......@@ -3022,7 +3035,7 @@ class Issue295Person
public DateTime? DoB { get; set; }
public DateTime? DoB2 { get; set; }
}
#if EXTERNALS
#if FIREBIRD
[Fact(Skip="Bug in Firebird; a PR to fix it has been submitted")]
public void Issue178_Firebird()
{
......@@ -3059,7 +3072,9 @@ public void Issue178_Firebird()
count.IsEqualTo(1);
}
}
#endif
#if OLEDB
[Fact]
public void PseudoPositionalParameters_Simple()
{
......@@ -3204,9 +3219,9 @@ class Cat
};
[Fact]
public void TestPostresqlArrayParameters()
public void TestPostgresqlArrayParameters()
{
using (var conn = new NpgsqlConnection("Server=localhost;Port=5432;User Id=dappertest;Password=dapperpass;Database=dappertest;Encoding=UNICODE"))
using (var conn = new NpgsqlConnection("Server=localhost;Port=5432;User Id=dappertest;Password=dapperpass;Database=dappertest")) // ;Encoding=UNICODE
{
conn.Open();
IDbTransaction transaction = conn.BeginTransaction();
......
......@@ -26,7 +26,18 @@
"frameworks": {
"net40": {
"compilationOptions": {
"define": [ "MYSQL" ]
"define": [
"MYSQL",
"ENTITY_FRAMEWORK",
"LINQ2SQL",
"FIREBIRD",
"SQL_CE",
"OLEDB",
"MASSIVE",
"ORMLITE",
"SOMA",
"SIMPLEDATA"
]
},
"frameworkAssemblies": {
"System.Configuration": "4.0.0.0",
......@@ -35,17 +46,40 @@
"System.Xml": "4.0.0.0"
},
"dependencies": {
"Dapper.EntityFramework": {
"target": "project"
},
"EntityFramework": "6.1.3",
"FirebirdSql.Data.FirebirdClient": "4.10.0",
"Microsoft.SqlServer.Types": "11.0.2",
"MySql.Data": "6.9.8",
"NHibernate": "4.0.4.4000",
"ServiceStack.OrmLite": "4.0.48",
"ServiceStack.OrmLite.SqlServer": "4.0.48",
"Simple.Data.Ado": "1.0.0-rc3",
"Simple.Data.Core": "1.0.0-rc3",
"Simple.Data.SqlServer": "1.0.0-rc3",
"Soma": "1.8.0.7",
"xunit": "1.9.2",
"MySql.Data": "6.9.8"
"System.Data.SqlServerCe_unofficial": "4.0.8482.1",
"xunit": "1.9.2"
}
},
"net45": {
"compilationOptions": {
"define": [ "ASYNC", "MYSQL" ]
"define": [
"ASYNC",
"MYSQL",
"ENTITY_FRAMEWORK",
"LINQ2SQL",
"FIREBIRD",
"SQL_CE",
"POSTGRESQL",
"OLEDB",
"MASSIVE",
"ORMLITE",
"SOMA",
"SIMPLEDATA"
]
},
"frameworkAssemblies": {
"System.Configuration": "4.0.0.0",
......@@ -55,12 +89,25 @@
"System.Xml": "4.0.0.0"
},
"dependencies": {
"Dapper.EntityFramework": {
"target": "project"
},
"EntityFramework": "6.1.3",
"FirebirdSql.Data.FirebirdClient": "4.10.0",
"Microsoft.SqlServer.Types": "11.0.2",
"MySql.Data": "6.9.8",
"NHibernate": "4.0.4.4000",
"Npgsql": "3.0.5",
"ServiceStack.OrmLite": "4.0.48",
"ServiceStack.OrmLite.SqlServer": "4.0.48",
"Simple.Data.Ado": "2.0.0-alpha1",
"Simple.Data.Core": "2.0.0-alpha1",
"Simple.Data.SqlServer": "2.0.0-alpha1",
"Soma": "1.8.0.7",
"xunit": "2.1.0",
"MySql.Data": "6.9.8"
"Susanoo.Core": "1.2.4",
"Susanoo.SqlServer": "1.2.4",
"System.Data.SqlServerCe_unofficial": "4.0.8482.1",
"xunit": "2.1.0"
}
},
"dotnet5.4": {
......@@ -80,37 +127,50 @@
},
"dnx451": {
"compilationOptions": {
"define": [ "ASYNC", "EXTERNALS", "DNX", "MYSQL" ]
"define": [
"ASYNC",
"MYSQL",
"ENTITY_FRAMEWORK",
"LINQ2SQL",
"FIREBIRD",
"SQL_CE",
"POSTGRESQL",
"OLEDB",
"MASSIVE",
"ORMLITE",
"SOMA",
"SIMPLEDATA"
]
},
"frameworkAssemblies": {
"System.Configuration": "4.0.0.0",
"System.Data.Linq": "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": {
"NHibernate": "4.0.4.4000",
"NHibernate.ByteCode.LinFu": "1.1.0",
"NHibernate.ByteCode.Castle": "3.3.3.4000",
"Dapper.EntityFramework": {
"target": "project"
},
"EntityFramework": "6.1.3",
"FirebirdSql.Data.FirebirdClient": "4.10.0",
"Microsoft.SqlServer.Types": "11.0.2",
"MySql.Data": "6.9.8",
"NHibernate": "4.0.4.4000",
"Npgsql": "3.0.5",
"ServiceStack.OrmLite": "4.0.48",
"ServiceStack.OrmLite.SqlServer": "4.0.48",
"Microsoft.SqlServer.Compact": "4.0.8876.1",
"Microsoft.SqlServer.Types": "11.0.2",
"Npgsql": "2.1.0",
"Soma": "1.8.0.7",
"xunit": "2.1.0",
"xunit.runner.dnx": "2.1.0-*",
"BLToolkit": "4.1.21",
"Susanoo.Core": "0.8.4.36",
"SubSonic": "3.0.0.4",
"Simple.Data.Ado": "2.0.0-alpha1",
"Simple.Data.Core": "2.0.0-alpha1",
"Simple.Data.SqlServer": "2.0.0-alpha1",
"FirebirdSql.Data.FirebirdClient": "4.8.1.1",
"Dapper.EntityFramework": {
"target": "project"
},
"MySql.Data": "6.9.8"
"Soma": "1.8.0.7",
"Susanoo.Core": "1.2.4",
"Susanoo.SqlServer": "1.2.4",
"System.Data.SqlServerCe_unofficial": "4.0.8482.1",
"xunit": "2.2.0-beta1-build3239",
"xunit.runner.dnx": "2.1.0-rc1-build204"
}
},
"dnxcore50": {
"compilationOptions": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment