Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Dapper
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
Dapper
Commits
a4bb66de
Commit
a4bb66de
authored
Feb 11, 2016
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test cleanup; enable lots more tests hidden previously as EXTERNALS
parent
19afe1ed
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
294 additions
and
146 deletions
+294
-146
EFContext.cs
Dapper.Tests/EntityFramework/EFContext.cs
+1
-1
NHibernateHelper.cs
Dapper.Tests/NHibernate/NHibernateHelper.cs
+1
-1
PerformanceTests.cs
Dapper.Tests/PerformanceTests.cs
+158
-95
Program.cs
Dapper.Tests/Program.cs
+5
-3
Tests.Async.cs
Dapper.Tests/Tests.Async.cs
+1
-1
Tests.Constructors.cs
Dapper.Tests/Tests.Constructors.cs
+1
-1
Tests.Parameters.cs
Dapper.Tests/Tests.Parameters.cs
+13
-5
Tests.cs
Dapper.Tests/Tests.cs
+28
-13
project.json
Dapper.Tests/project.json
+86
-26
No files found.
Dapper.Tests/EntityFramework/EFContext.cs
View file @
a4bb66de
#
if
E
XTERNALS
#
if
E
NTITY_FRAMEWORK
using
System.Data.Common
;
using
System.Data.Entity
;
...
...
Dapper.Tests/NHibernate/NHibernateHelper.cs
View file @
a4bb66de
#
if
EXTERNALS
#
if
NHIBERNATE
using
NHibernate
;
using
NHibernate.Cfg
;
...
...
Dapper.Tests/PerformanceTests.cs
View file @
a4bb66de
This diff is collapsed.
Click to expand it.
Dapper.Tests/Program.cs
View file @
a4bb66de
...
...
@@ -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
;
}
...
...
Dapper.Tests/Tests.Async.cs
View file @
a4bb66de
...
...
@@ -192,7 +192,7 @@ public async Task TestMultiClosedConnAsyncViaFirstOrDefault()
}
}
#if
EXTERNALS
#if
!COREFX
[
Fact
]
public
async
Task
ExecuteReaderOpenAsync
()
{
...
...
Dapper.Tests/Tests.Constructors.cs
View file @
a4bb66de
...
...
@@ -114,7 +114,7 @@ public bool GetWentThroughProperConstructor()
}
}
#if
EXTERNALS
#if
LINQ2SQL
class
NoDefaultConstructorWithBinary
{
public
System
.
Data
.
Linq
.
Binary
Value
{
get
;
set
;
}
...
...
Dapper.Tests/Tests.Parameters.cs
View file @
a4bb66de
...
...
@@ -9,7 +9,7 @@
using
System.Linq
;
using
Xunit
;
#if E
XTERNALS
#if E
NTITY_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
()
...
...
Dapper.Tests/Tests.cs
View file @
a4bb66de
...
...
@@ -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 && !DN
X
#if
!COREF
X
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 E
XTERNALS
#if E
NTITY_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
TestPost
g
resqlArrayParameters
()
{
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
();
...
...
Dapper.Tests/project.json
View file @
a4bb66de
...
...
@@ -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"
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment