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
5189fcd4
Commit
5189fcd4
authored
Aug 31, 2018
by
David Glassborow
Committed by
Nick Craver
Sep 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests for #1111 - Inconsistent deserialisation between normal Query<T> and SqlMapper.Parse<T>
parent
522d150e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
DataReaderTests.cs
Dapper.Tests/DataReaderTests.cs
+10
-0
TypeHandlerTests.cs
Dapper.Tests/TypeHandlerTests.cs
+7
-0
No files found.
Dapper.Tests/DataReaderTests.cs
View file @
5189fcd4
...
@@ -38,6 +38,16 @@ public void GetSameReaderForSameShape()
...
@@ -38,6 +38,16 @@ public void GetSameReaderForSameShape()
Assert
.
False
(
ReferenceEquals
(
secondParser
,
thirdParser
));
Assert
.
False
(
ReferenceEquals
(
secondParser
,
thirdParser
));
}
}
[
Fact
]
public
void
TestTreatIntAsABool
()
{
// Test we are consistent with direct call to database, see TypeHandlerTests.TestTreatIntAsABool
using
(
var
reader
=
connection
.
ExecuteReader
(
"select CAST(1 AS BIT)"
))
Assert
.
True
(
SqlMapper
.
Parse
<
bool
>(
reader
).
Single
());
using
(
var
reader
=
connection
.
ExecuteReader
(
"select 1"
))
Assert
.
True
(
SqlMapper
.
Parse
<
bool
>(
reader
).
Single
());
}
[
Fact
]
[
Fact
]
public
void
DiscriminatedUnion
()
public
void
DiscriminatedUnion
()
{
{
...
...
Dapper.Tests/TypeHandlerTests.cs
View file @
5189fcd4
...
@@ -592,6 +592,13 @@ public void TestWrongTypes_WithWrongTypes()
...
@@ -592,6 +592,13 @@ public void TestWrongTypes_WithWrongTypes()
Assert
.
True
(
item
.
D
);
Assert
.
True
(
item
.
D
);
}
}
[
Fact
]
public
void
TestTreatIntAsABool
()
{
Assert
.
True
(
connection
.
Query
<
bool
>(
"select CAST(1 AS BIT)"
).
Single
());
Assert
.
True
(
connection
.
Query
<
bool
>(
"select 1"
).
Single
());
}
[
Fact
]
[
Fact
]
public
void
SO24607639_NullableBools
()
public
void
SO24607639_NullableBools
()
{
{
...
...
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