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
4d75b982
Commit
4d75b982
authored
May 08, 2017
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests: make analyzers happy because why not
parent
b5b65e60
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
20 additions
and
12 deletions
+20
-12
TestSuite.cs
Dapper.Tests.Contrib/TestSuite.cs
+1
-1
Massive.cs
Dapper.Tests.Performance/Massive/Massive.cs
+4
-0
PerformanceTests.cs
Dapper.Tests.Performance/PerformanceTests.cs
+2
-2
PetaPoco.cs
Dapper.Tests.Performance/PetaPoco/PetaPoco.cs
+5
-3
SomaConfig.cs
Dapper.Tests.Performance/Soma/SomaConfig.cs
+1
-1
AsyncTests.cs
Dapper.Tests/AsyncTests.cs
+1
-1
ConstructorTests.cs
Dapper.Tests/ConstructorTests.cs
+1
-1
MiscTests.cs
Dapper.Tests/MiscTests.cs
+2
-0
MySQLTests.cs
Dapper.Tests/Providers/MySQLTests.cs
+1
-1
PostgresqlTests.cs
Dapper.Tests/Providers/PostgresqlTests.cs
+1
-1
TypeHandlerTests.cs
Dapper.Tests/TypeHandlerTests.cs
+1
-1
No files found.
Dapper.Tests.Contrib/TestSuite.cs
View file @
4d75b982
...
@@ -469,7 +469,7 @@ public void InsertWithCustomTableNameMapper()
...
@@ -469,7 +469,7 @@ public void InsertWithCustomTableNameMapper()
var
name
=
type
.
Name
+
"s"
;
var
name
=
type
.
Name
+
"s"
;
if
(
type
.
IsInterface
()
&&
name
.
StartsWith
(
"I"
))
if
(
type
.
IsInterface
()
&&
name
.
StartsWith
(
"I"
))
name
=
name
.
Substring
(
1
);
return
name
.
Substring
(
1
);
return
name
;
return
name
;
}
}
};
};
...
...
Dapper.Tests.Performance/Massive/Massive.cs
View file @
4d75b982
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
#pragma warning disable RCS1141 // Add parameter to documentation comment.
namespace
Massive
namespace
Massive
{
{
public
static
class
ObjectExtensions
public
static
class
ObjectExtensions
...
@@ -115,7 +116,9 @@ public class DynamicModel
...
@@ -115,7 +116,9 @@ public class DynamicModel
{
{
private
readonly
DbProviderFactory
_factory
;
private
readonly
DbProviderFactory
_factory
;
#pragma warning disable 0649
#pragma warning disable 0649
#pragma warning disable RCS1169 // Mark field as read-only.
private
string
_connectionString
;
private
string
_connectionString
;
#pragma warning restore RCS1169 // Mark field as read-only.
#pragma warning restore 0649
#pragma warning restore 0649
public
DynamicModel
(
string
connectionStringName
=
""
,
string
tableName
=
""
,
string
primaryKeyField
=
""
)
public
DynamicModel
(
string
connectionStringName
=
""
,
string
tableName
=
""
,
string
primaryKeyField
=
""
)
...
@@ -450,4 +453,5 @@ public virtual dynamic Single(object key, string columns = "*")
...
@@ -450,4 +453,5 @@ public virtual dynamic Single(object key, string columns = "*")
}
}
}
}
}
}
#pragma warning restore RCS1141 // Add parameter to documentation comment.
#
endif
#
endif
\ No newline at end of file
Dapper.Tests.Performance/PerformanceTests.cs
View file @
4d75b982
...
@@ -51,7 +51,7 @@ public void Add(Action<int> iteration, string name)
...
@@ -51,7 +51,7 @@ public void Add(Action<int> iteration, string name)
Add
(
new
Test
(
iteration
,
name
));
Add
(
new
Test
(
iteration
,
name
));
}
}
public
void
A
ddAsync
(
Func
<
int
,
Task
>
iterationAsync
,
string
name
)
public
void
A
syncAdd
(
Func
<
int
,
Task
>
iterationAsync
,
string
name
)
{
{
Add
(
new
Test
(
iterationAsync
,
name
));
Add
(
new
Test
(
iterationAsync
,
name
));
}
}
...
@@ -230,7 +230,7 @@ public async Task RunAsync(int iterations)
...
@@ -230,7 +230,7 @@ public async Task RunAsync(int iterations)
Try
(()
=>
Try
(()
=>
{
{
var
query
=
new
Belgrade
.
SqlClient
.
SqlDb
.
QueryMapper
(
ConnectionString
);
var
query
=
new
Belgrade
.
SqlClient
.
SqlDb
.
QueryMapper
(
ConnectionString
);
tests
.
A
ddAsync
(
id
=>
query
.
ExecuteReader
(
"SELECT TOP 1 * FROM Posts WHERE Id = "
+
id
,
tests
.
A
syncAdd
(
id
=>
query
.
ExecuteReader
(
"SELECT TOP 1 * FROM Posts WHERE Id = "
+
id
,
reader
=>
reader
=>
{
{
var
post
=
new
Post
();
var
post
=
new
Post
();
...
...
Dapper.Tests.Performance/PetaPoco/PetaPoco.cs
View file @
4d75b982
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
using
System.Reflection
;
using
System.Reflection
;
using
System.Reflection.Emit
;
using
System.Reflection.Emit
;
#pragma warning disable RCS1023 // Format empty block.
namespace
PetaPoco
namespace
PetaPoco
{
{
// Poco's marked [Explicit] require all column properties to be marked
// Poco's marked [Explicit] require all column properties to be marked
...
@@ -37,8 +38,8 @@ public class Column : Attribute
...
@@ -37,8 +38,8 @@ public class Column : Attribute
public
class
ResultColumn
:
Column
public
class
ResultColumn
:
Column
{
{
public
ResultColumn
()
{
}
public
ResultColumn
()
{
}
public
ResultColumn
(
string
name
)
:
base
(
name
)
{
}
public
ResultColumn
(
string
name
)
:
base
(
name
)
{
}
}
}
// Specify the table name of a poco
// Specify the table name of a poco
[
AttributeUsage
(
AttributeTargets
.
Class
)]
[
AttributeUsage
(
AttributeTargets
.
Class
)]
...
@@ -1287,7 +1288,7 @@ public void Dispose()
...
@@ -1287,7 +1288,7 @@ public void Dispose()
_db
.
CloseSharedConnection
();
_db
.
CloseSharedConnection
();
}
}
}
}
// Member variables
// Member variables
private
readonly
string
_connectionString
;
private
readonly
string
_connectionString
;
private
readonly
string
_providerName
;
private
readonly
string
_providerName
;
...
@@ -1441,4 +1442,5 @@ public void Build(StringBuilder sb, List<object> args, Sql lhs)
...
@@ -1441,4 +1442,5 @@ public void Build(StringBuilder sb, List<object> args, Sql lhs)
}
}
}
}
}
}
#pragma warning restore RCS1023 // Format empty block.
#
endif
#
endif
\ No newline at end of file
Dapper.Tests.Performance/Soma/SomaConfig.cs
View file @
4d75b982
...
@@ -9,6 +9,6 @@ internal class SomaConfig : MsSqlConfig
...
@@ -9,6 +9,6 @@ internal class SomaConfig : MsSqlConfig
public
override
Action
<
PreparedStatement
>
Logger
=>
noOp
;
public
override
Action
<
PreparedStatement
>
Logger
=>
noOp
;
private
static
readonly
Action
<
PreparedStatement
>
noOp
=
x
=>
{
};
private
static
readonly
Action
<
PreparedStatement
>
noOp
=
x
=>
{
/* nope */
};
}
}
}
}
Dapper.Tests/AsyncTests.cs
View file @
4d75b982
...
@@ -791,7 +791,7 @@ public async Task Issue563_QueryAsyncShouldThrowException()
...
@@ -791,7 +791,7 @@ public async Task Issue563_QueryAsyncShouldThrowException()
var
data
=
(
await
connection
.
QueryAsync
<
int
>(
"select 1 union all select 2; RAISERROR('after select', 16, 1);"
).
ConfigureAwait
(
false
)).
ToList
();
var
data
=
(
await
connection
.
QueryAsync
<
int
>(
"select 1 union all select 2; RAISERROR('after select', 16, 1);"
).
ConfigureAwait
(
false
)).
ToList
();
Assert
.
Fail
();
Assert
.
Fail
();
}
}
catch
(
SqlException
ex
)
when
(
ex
.
Message
==
"after select"
)
{
}
catch
(
SqlException
ex
)
when
(
ex
.
Message
==
"after select"
)
{
/* swallow only this */
}
}
}
}
}
}
}
\ No newline at end of file
Dapper.Tests/ConstructorTests.cs
View file @
4d75b982
...
@@ -90,7 +90,7 @@ private class _ExplicitConstructors
...
@@ -90,7 +90,7 @@ private class _ExplicitConstructors
private
readonly
bool
WentThroughProperConstructor
;
private
readonly
bool
WentThroughProperConstructor
;
public
_ExplicitConstructors
()
{
}
public
_ExplicitConstructors
()
{
/* yep */
}
[
ExplicitConstructor
]
[
ExplicitConstructor
]
public
_ExplicitConstructors
(
string
foo
,
int
bar
)
public
_ExplicitConstructors
(
string
foo
,
int
bar
)
...
...
Dapper.Tests/MiscTests.cs
View file @
4d75b982
...
@@ -471,7 +471,9 @@ private class TestFieldCaseAndPrivatesEntity
...
@@ -471,7 +471,9 @@ private class TestFieldCaseAndPrivatesEntity
private
int
b
{
get
;
set
;
}
private
int
b
{
get
;
set
;
}
public
int
GetB
()
{
return
b
;
}
public
int
GetB
()
{
return
b
;
}
public
int
c
=
0
;
public
int
c
=
0
;
#pragma warning disable RCS1169 // Mark field as read-only.
private
int
d
=
0
;
private
int
d
=
0
;
#pragma warning restore RCS1169 // Mark field as read-only.
public
int
GetD
()
{
return
d
;
}
public
int
GetD
()
{
return
d
;
}
public
int
e
{
get
;
set
;
}
public
int
e
{
get
;
set
;
}
private
string
f
private
string
f
...
...
Dapper.Tests/Providers/MySQLTests.cs
View file @
4d75b982
...
@@ -176,7 +176,7 @@ static FactMySqlAttribute()
...
@@ -176,7 +176,7 @@ static FactMySqlAttribute()
{
{
try
try
{
{
using
(
GetMySqlConnection
(
true
))
{
}
using
(
GetMySqlConnection
(
true
))
{
/* just trying to see if it works */
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
Dapper.Tests/Providers/PostgresqlTests.cs
View file @
4d75b982
...
@@ -71,7 +71,7 @@ static FactPostgresqlAttribute()
...
@@ -71,7 +71,7 @@ static FactPostgresqlAttribute()
{
{
try
try
{
{
using
(
GetOpenNpgsqlConnection
())
{
}
using
(
GetOpenNpgsqlConnection
())
{
/* just trying to see if it works */
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
Dapper.Tests/TypeHandlerTests.cs
View file @
4d75b982
...
@@ -69,7 +69,7 @@ public void Issue136_ValueTypeHandlers()
...
@@ -69,7 +69,7 @@ public void Issue136_ValueTypeHandlers()
public
class
LocalDateHandler
:
SqlMapper
.
TypeHandler
<
LocalDate
>
public
class
LocalDateHandler
:
SqlMapper
.
TypeHandler
<
LocalDate
>
{
{
private
LocalDateHandler
()
{
}
private
LocalDateHandler
()
{
/* private constructor */
}
// Make the field type ITypeHandler to ensure it cannot be used with SqlMapper.AddTypeHandler<T>(TypeHandler<T>)
// Make the field type ITypeHandler to ensure it cannot be used with SqlMapper.AddTypeHandler<T>(TypeHandler<T>)
// by mistake.
// by mistake.
...
...
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