Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Dapper
提交
583f98f6
D
Dapper
项目概览
int
/
Dapper
大约 1 年 前同步成功
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Dapper
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
583f98f6
编写于
11月 19, 2015
作者:
M
Marc Gravell
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #403 from StackExchange/dnxunit
Port tests to xUnit
上级
a7ee3092
26515d1a
变更
12
展开全部
显示空白变更内容
内联
并排
Showing
12 changed file
with
2525 addition
and
2102 deletion
+2525
-2102
.gitignore
.gitignore
+2
-1
Dapper.DNX.Tests/Assert.cs
Dapper.DNX.Tests/Assert.cs
+7
-30
Dapper.DNX.Tests/Dapper.DNX.Tests.xproj
Dapper.DNX.Tests/Dapper.DNX.Tests.xproj
+3
-0
Dapper.DNX.Tests/Program.cs
Dapper.DNX.Tests/Program.cs
+5
-2
Dapper.DNX.Tests/Tests.Async.cs
Dapper.DNX.Tests/Tests.Async.cs
+178
-132
Dapper.DNX.Tests/Tests.Constructors.cs
Dapper.DNX.Tests/Tests.Constructors.cs
+227
-0
Dapper.DNX.Tests/Tests.Enums.cs
Dapper.DNX.Tests/Tests.Enums.cs
+92
-0
Dapper.DNX.Tests/Tests.MultiMap.cs
Dapper.DNX.Tests/Tests.MultiMap.cs
+616
-0
Dapper.DNX.Tests/Tests.Parameters.cs
Dapper.DNX.Tests/Tests.Parameters.cs
+990
-0
Dapper.DNX.Tests/Tests.QueryMultiple.cs
Dapper.DNX.Tests/Tests.QueryMultiple.cs
+148
-0
Dapper.DNX.Tests/Tests.cs
Dapper.DNX.Tests/Tests.cs
+226
-1931
Dapper.DNX.Tests/project.json
Dapper.DNX.Tests/project.json
+31
-6
未找到文件。
.gitignore
浏览文件 @
583f98f6
...
...
@@ -11,3 +11,4 @@ NuGet.exe
.docstats
*.ide/
*.lock.json
*.coverage
\ No newline at end of file
Dapper.DNX.Tests/Assert.cs
浏览文件 @
583f98f6
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
#if DOTNET5_2
using
ApplicationException
=
System
.
InvalidOperationException
;
#endif
namespace
SqlMapper
{
...
...
@@ -13,54 +8,36 @@ static class Assert
public
static
void
IsEqualTo
<
T
>(
this
T
obj
,
T
other
)
{
if
(!
Equals
(
obj
,
other
))
{
throw
new
ApplicationException
(
$"
{
obj
}
should be equals to
{
other
}
"
);
}
Xunit
.
Assert
.
Equal
(
obj
,
other
);
}
public
static
void
IsSequenceEqualTo
<
T
>(
this
IEnumerable
<
T
>
obj
,
IEnumerable
<
T
>
other
)
{
if
(!(
obj
??
new
T
[
0
]).
SequenceEqual
(
other
??
new
T
[
0
]))
{
throw
new
ApplicationException
(
$"
{
obj
}
should be equals to
{
other
}
"
);
}
Xunit
.
Assert
.
Equal
(
obj
??
new
T
[
0
],
other
);
}
public
static
void
Fail
()
{
throw
new
ApplicationException
(
"Expectation failed"
);
Xunit
.
Assert
.
True
(
false
,
"Expectation failed"
);
}
public
static
void
IsFalse
(
this
bool
b
)
{
if
(
b
)
{
throw
new
ApplicationException
(
"Expected false"
);
}
Xunit
.
Assert
.
False
(
b
);
}
public
static
void
IsTrue
(
this
bool
b
)
{
if
(!
b
)
{
throw
new
ApplicationException
(
"Expected true"
);
}
Xunit
.
Assert
.
True
(
b
);
}
public
static
void
IsNull
(
this
object
obj
)
{
if
(
obj
!=
null
)
{
throw
new
ApplicationException
(
"Expected null"
);
}
Xunit
.
Assert
.
Null
(
obj
);
}
public
static
void
IsNotNull
(
this
object
obj
)
{
if
(
obj
==
null
)
{
throw
new
ApplicationException
(
"Expected not null"
);
}
Xunit
.
Assert
.
NotNull
(
obj
);
}
}
}
Dapper.DNX.Tests/Dapper.DNX.Tests.xproj
浏览文件 @
583f98f6
...
...
@@ -17,5 +17,8 @@
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"
>
<ProduceOutputsOnBuild>
True
</ProduceOutputsOnBuild>
</PropertyGroup>
<ItemGroup>
<Service
Include=
"{82a7f48d-3b50-4b1e-b82e-3ada8210c358}"
/>
</ItemGroup>
<Import
Project=
"$(VSToolsPath)\DNX\Microsoft.DNX.targets"
Condition=
"'$(VSToolsPath)' != ''"
/>
</Project>
\ No newline at end of file
Dapper.DNX.Tests/Program.cs
浏览文件 @
583f98f6
...
...
@@ -171,7 +171,7 @@ insert Posts ([Text],CreationDate, LastChangeDate) values (replicate('x', 2000),
#endif
}
private
static
void
RunTests
<
T
>(
ref
int
fail
,
ref
int
skip
,
ref
int
pass
,
ref
int
frameworkFail
,
List
<
string
>
failNames
)
where
T
:
class
,
new
()
private
static
void
RunTests
<
T
>(
ref
int
fail
,
ref
int
skip
,
ref
int
pass
,
ref
int
frameworkFail
,
List
<
string
>
failNames
)
where
T
:
class
,
IDisposable
,
new
()
{
var
tester
=
new
T
();
using
(
tester
as
IDisposable
)
...
...
@@ -193,7 +193,10 @@ private static void RunTests<T>(ref int fail, ref int skip, ref int pass, ref in
Console
.
Write
(
"Running "
+
method
.
Name
);
try
{
method
.
Invoke
(
tester
,
null
);
using
(
var
t
=
new
T
())
{
method
.
Invoke
(
t
,
null
);
}
if
(
expectFrameworkFail
)
{
Console
.
WriteLine
(
" - was expected to framework-fail, but didn't"
);
...
...
Dapper.DNX.Tests/Tests.Async.cs
浏览文件 @
583f98f6
此差异已折叠。
点击以展开。
Dapper.DNX.Tests/Tests.Constructors.cs
0 → 100644
浏览文件 @
583f98f6
using
Dapper
;
using
System
;
using
System.Data
;
using
System.Linq
;
using
Xunit
;
#if DOTNET5_2
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
SqlMapper
{
public
partial
class
Tests
{
[
Fact
]
public
void
TestAbstractInheritance
()
{
var
order
=
connection
.
Query
<
AbstractInheritance
.
ConcreteOrder
>(
"select 1 Internal,2 Protected,3 [Public],4 Concrete"
).
First
();
order
.
Internal
.
IsEqualTo
(
1
);
order
.
ProtectedVal
.
IsEqualTo
(
2
);
order
.
Public
.
IsEqualTo
(
3
);
order
.
Concrete
.
IsEqualTo
(
4
);
}
[
Fact
]
public
void
TestMultipleConstructors
()
{
MultipleConstructors
mult
=
connection
.
Query
<
MultipleConstructors
>(
"select 0 A, 'Dapper' b"
).
First
();
mult
.
A
.
IsEqualTo
(
0
);
mult
.
B
.
IsEqualTo
(
"Dapper"
);
}
[
Fact
]
public
void
TestConstructorsWithAccessModifiers
()
{
ConstructorsWithAccessModifiers
value
=
connection
.
Query
<
ConstructorsWithAccessModifiers
>(
"select 0 A, 'Dapper' b"
).
First
();
value
.
A
.
IsEqualTo
(
1
);
value
.
B
.
IsEqualTo
(
"Dapper!"
);
}
[
Fact
]
public
void
TestNoDefaultConstructor
()
{
var
guid
=
Guid
.
NewGuid
();
NoDefaultConstructor
nodef
=
connection
.
Query
<
NoDefaultConstructor
>(
"select CAST(NULL AS integer) A1, CAST(NULL AS integer) b1, CAST(NULL AS real) f1, 'Dapper' s1, G1 = @id"
,
new
{
id
=
guid
}).
First
();
nodef
.
A
.
IsEqualTo
(
0
);
nodef
.
B
.
IsEqualTo
(
null
);
nodef
.
F
.
IsEqualTo
(
0
);
nodef
.
S
.
IsEqualTo
(
"Dapper"
);
nodef
.
G
.
IsEqualTo
(
guid
);
}
[
Fact
]
public
void
TestNoDefaultConstructorWithChar
()
{
const
char
c1
=
'ą'
;
const
char
c3
=
'ó'
;
NoDefaultConstructorWithChar
nodef
=
connection
.
Query
<
NoDefaultConstructorWithChar
>(
"select @c1 c1, @c2 c2, @c3 c3"
,
new
{
c1
=
c1
,
c2
=
(
char
?)
null
,
c3
=
c3
}).
First
();
nodef
.
Char1
.
IsEqualTo
(
c1
);
nodef
.
Char2
.
IsEqualTo
(
null
);
nodef
.
Char3
.
IsEqualTo
(
c3
);
}
[
Fact
]
public
void
TestNoDefaultConstructorWithEnum
()
{
NoDefaultConstructorWithEnum
nodef
=
connection
.
Query
<
NoDefaultConstructorWithEnum
>(
"select cast(2 as smallint) E1, cast(5 as smallint) n1, cast(null as smallint) n2"
).
First
();
nodef
.
E
.
IsEqualTo
(
ShortEnum
.
Two
);
nodef
.
NE1
.
IsEqualTo
(
ShortEnum
.
Five
);
nodef
.
NE2
.
IsEqualTo
(
null
);
}
[
Fact
]
public
void
ExplicitConstructors
()
{
var
rows
=
connection
.
Query
<
_ExplicitConstructors
>(
@"
declare @ExplicitConstructors table (
Field INT NOT NULL PRIMARY KEY IDENTITY(1,1),
Field_1 INT NOT NULL);
insert @ExplicitConstructors(Field_1) values (1);
SELECT * FROM @ExplicitConstructors"
).
ToList
();
rows
.
Count
.
IsEqualTo
(
1
);
rows
[
0
].
Field
.
IsEqualTo
(
1
);
rows
[
0
].
Field_1
.
IsEqualTo
(
1
);
rows
[
0
].
GetWentThroughProperConstructor
().
IsTrue
();
}
class
_ExplicitConstructors
{
public
int
Field
{
get
;
set
;
}
public
int
Field_1
{
get
;
set
;
}
private
bool
WentThroughProperConstructor
;
public
_ExplicitConstructors
()
{
}
[
ExplicitConstructor
]
public
_ExplicitConstructors
(
string
foo
,
int
bar
)
{
WentThroughProperConstructor
=
true
;
}
public
bool
GetWentThroughProperConstructor
()
{
return
WentThroughProperConstructor
;
}
}
#if EXTERNALS
class
NoDefaultConstructorWithBinary
{
public
System
.
Data
.
Linq
.
Binary
Value
{
get
;
set
;
}
public
int
Ynt
{
get
;
set
;
}
public
NoDefaultConstructorWithBinary
(
System
.
Data
.
Linq
.
Binary
val
)
{
Value
=
val
;
}
}
[
Fact
]
public
void
TestNoDefaultConstructorBinary
()
{
byte
[]
orig
=
new
byte
[
20
];
new
Random
(
123456
).
NextBytes
(
orig
);
var
input
=
new
System
.
Data
.
Linq
.
Binary
(
orig
);
var
output
=
connection
.
Query
<
NoDefaultConstructorWithBinary
>(
"select @input as val"
,
new
{
input
}).
First
().
Value
;
output
.
ToArray
().
IsSequenceEqualTo
(
orig
);
}
#endif
public
class
AbstractInheritance
{
public
abstract
class
Order
{
internal
int
Internal
{
get
;
set
;
}
protected
int
Protected
{
get
;
set
;
}
public
int
Public
{
get
;
set
;
}
public
int
ProtectedVal
=>
Protected
;
}
public
class
ConcreteOrder
:
Order
{
public
int
Concrete
{
get
;
set
;
}
}
}
class
MultipleConstructors
{
public
MultipleConstructors
()
{
}
public
MultipleConstructors
(
int
a
,
string
b
)
{
A
=
a
+
1
;
B
=
b
+
"!"
;
}
public
int
A
{
get
;
set
;
}
public
string
B
{
get
;
set
;
}
}
class
ConstructorsWithAccessModifiers
{
private
ConstructorsWithAccessModifiers
()
{
}
public
ConstructorsWithAccessModifiers
(
int
a
,
string
b
)
{
A
=
a
+
1
;
B
=
b
+
"!"
;
}
public
int
A
{
get
;
set
;
}
public
string
B
{
get
;
set
;
}
}
class
NoDefaultConstructor
{
public
NoDefaultConstructor
(
int
a1
,
int
?
b1
,
float
f1
,
string
s1
,
Guid
G1
)
{
A
=
a1
;
B
=
b1
;
F
=
f1
;
S
=
s1
;
G
=
G1
;
}
public
int
A
{
get
;
set
;
}
public
int
?
B
{
get
;
set
;
}
public
float
F
{
get
;
set
;
}
public
string
S
{
get
;
set
;
}
public
Guid
G
{
get
;
set
;
}
}
class
NoDefaultConstructorWithChar
{
public
NoDefaultConstructorWithChar
(
char
c1
,
char
?
c2
,
char
?
c3
)
{
Char1
=
c1
;
Char2
=
c2
;
Char3
=
c3
;
}
public
char
Char1
{
get
;
set
;
}
public
char
?
Char2
{
get
;
set
;
}
public
char
?
Char3
{
get
;
set
;
}
}
class
NoDefaultConstructorWithEnum
{
public
NoDefaultConstructorWithEnum
(
ShortEnum
e1
,
ShortEnum
?
n1
,
ShortEnum
?
n2
)
{
E
=
e1
;
NE1
=
n1
;
NE2
=
n2
;
}
public
ShortEnum
E
{
get
;
set
;
}
public
ShortEnum
?
NE1
{
get
;
set
;
}
public
ShortEnum
?
NE2
{
get
;
set
;
}
}
}
}
Dapper.DNX.Tests/Tests.Enums.cs
0 → 100644
浏览文件 @
583f98f6
using
Dapper
;
using
System
;
using
System.Data
;
using
System.Linq
;
using
Xunit
;
#if DOTNET5_2
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
SqlMapper
{
public
partial
class
Tests
{
[
Fact
]
public
void
TestEnumWeirdness
()
{
connection
.
Query
<
TestEnumClass
>(
"select null as [EnumEnum]"
).
First
().
EnumEnum
.
IsEqualTo
(
null
);
connection
.
Query
<
TestEnumClass
>(
"select cast(1 as tinyint) as [EnumEnum]"
).
First
().
EnumEnum
.
IsEqualTo
(
TestEnum
.
Bla
);
}
[
Fact
]
public
void
TestEnumStrings
()
{
connection
.
Query
<
TestEnumClassNoNull
>(
"select 'BLA' as [EnumEnum]"
).
First
().
EnumEnum
.
IsEqualTo
(
TestEnum
.
Bla
);
connection
.
Query
<
TestEnumClassNoNull
>(
"select 'bla' as [EnumEnum]"
).
First
().
EnumEnum
.
IsEqualTo
(
TestEnum
.
Bla
);
connection
.
Query
<
TestEnumClass
>(
"select 'BLA' as [EnumEnum]"
).
First
().
EnumEnum
.
IsEqualTo
(
TestEnum
.
Bla
);
connection
.
Query
<
TestEnumClass
>(
"select 'bla' as [EnumEnum]"
).
First
().
EnumEnum
.
IsEqualTo
(
TestEnum
.
Bla
);
}
[
Fact
]
public
void
TestEnumParamsWithNullable
()
{
EnumParam
a
=
EnumParam
.
A
;
EnumParam
?
b
=
EnumParam
.
B
,
c
=
null
;
var
obj
=
connection
.
Query
<
EnumParamObject
>(
"select @a as A, @b as B, @c as C"
,
new
{
a
,
b
,
c
}).
Single
();
obj
.
A
.
IsEqualTo
(
EnumParam
.
A
);
obj
.
B
.
IsEqualTo
(
EnumParam
.
B
);
obj
.
C
.
IsEqualTo
(
null
);
}
[
Fact
]
public
void
TestEnumParamsWithoutNullable
()
{
EnumParam
a
=
EnumParam
.
A
;
EnumParam
b
=
EnumParam
.
B
,
c
=
0
;
var
obj
=
connection
.
Query
<
EnumParamObjectNonNullable
>(
"select @a as A, @b as B, @c as C"
,
new
{
a
,
b
,
c
}).
Single
();
obj
.
A
.
IsEqualTo
(
EnumParam
.
A
);
obj
.
B
.
IsEqualTo
(
EnumParam
.
B
);
obj
.
C
.
IsEqualTo
((
EnumParam
)
0
);
}
enum
EnumParam
:
short
{
None
,
A
,
B
}
class
EnumParamObject
{
public
EnumParam
A
{
get
;
set
;
}
public
EnumParam
?
B
{
get
;
set
;
}
public
EnumParam
?
C
{
get
;
set
;
}
}
class
EnumParamObjectNonNullable
{
public
EnumParam
A
{
get
;
set
;
}
public
EnumParam
?
B
{
get
;
set
;
}
public
EnumParam
?
C
{
get
;
set
;
}
}
enum
TestEnum
:
byte
{
Bla
=
1
}
class
TestEnumClass
{
public
TestEnum
?
EnumEnum
{
get
;
set
;
}
}
class
TestEnumClassNoNull
{
public
TestEnum
EnumEnum
{
get
;
set
;
}
}
}
}
Dapper.DNX.Tests/Tests.MultiMap.cs
0 → 100644
浏览文件 @
583f98f6
此差异已折叠。
点击以展开。
Dapper.DNX.Tests/Tests.Parameters.cs
0 → 100644
浏览文件 @
583f98f6
此差异已折叠。
点击以展开。
Dapper.DNX.Tests/Tests.QueryMultiple.cs
0 → 100644
浏览文件 @
583f98f6
using
Dapper
;
using
System
;
using
System.Data
;
using
System.Linq
;
using
Xunit
;
#if DOTNET5_2
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
SqlMapper
{
public
partial
class
Tests
{
[
Fact
]
public
void
TestQueryMultipleBuffered
()
{
using
(
var
grid
=
connection
.
QueryMultiple
(
"select 1; select 2; select @x; select 4"
,
new
{
x
=
3
}))
{
var
a
=
grid
.
Read
<
int
>();
var
b
=
grid
.
Read
<
int
>();
var
c
=
grid
.
Read
<
int
>();
var
d
=
grid
.
Read
<
int
>();
a
.
Single
().
Equals
(
1
);
b
.
Single
().
Equals
(
2
);
c
.
Single
().
Equals
(
3
);
d
.
Single
().
Equals
(
4
);
}
}
[
Fact
]
public
void
TestQueryMultipleNonBufferedIncorrectOrder
()
{
using
(
var
grid
=
connection
.
QueryMultiple
(
"select 1; select 2; select @x; select 4"
,
new
{
x
=
3
}))
{
var
a
=
grid
.
Read
<
int
>(
false
);
try
{
var
b
=
grid
.
Read
<
int
>(
false
);
throw
new
InvalidOperationException
();
// should have thrown
}
catch
(
InvalidOperationException
)
{
// that's expected
}
}
}
[
Fact
]
public
void
TestQueryMultipleNonBufferedCorrectOrder
()
{
using
(
var
grid
=
connection
.
QueryMultiple
(
"select 1; select 2; select @x; select 4"
,
new
{
x
=
3
}))
{
var
a
=
grid
.
Read
<
int
>(
false
).
Single
();
var
b
=
grid
.
Read
<
int
>(
false
).
Single
();
var
c
=
grid
.
Read
<
int
>(
false
).
Single
();
var
d
=
grid
.
Read
<
int
>(
false
).
Single
();
a
.
Equals
(
1
);
b
.
Equals
(
2
);
c
.
Equals
(
3
);
d
.
Equals
(
4
);
}
}
[
Fact
]
public
void
TestMultiReaderBasic
()
{
var
sql
=
@"select 1 as Id union all select 2 as Id select 'abc' as name select 1 as Id union all select 2 as Id"
;
int
i
,
j
;
string
s
;
using
(
var
multi
=
connection
.
QueryMultiple
(
sql
))
{
i
=
multi
.
Read
<
int
>().
First
();
s
=
multi
.
Read
<
string
>().
Single
();
j
=
multi
.
Read
<
int
>().
Sum
();
}
Assert
.
IsEqualTo
(
i
,
1
);
Assert
.
IsEqualTo
(
s
,
"abc"
);
Assert
.
IsEqualTo
(
j
,
3
);
}
[
Fact
]
public
void
TestReadDynamicWithGridReader
()
{
var
createSql
=
@"
create table #Users (Id int, Name varchar(20))
create table #Posts (Id int, OwnerId int, Content varchar(20))
insert #Users values(99, 'Sam')
insert #Users values(2, 'I am')
insert #Posts values(1, 99, 'Sams Post1')
insert #Posts values(2, 99, 'Sams Post2')
insert #Posts values(3, null, 'no ones post')"
;
try
{
connection
.
Execute
(
createSql
);
var
sql
=
@"SELECT * FROM #Users ORDER BY Id
SELECT * FROM #Posts ORDER BY Id DESC"
;
var
grid
=
connection
.
QueryMultiple
(
sql
);
var
users
=
grid
.
Read
().
ToList
();
var
posts
=
grid
.
Read
().
ToList
();
users
.
Count
.
IsEqualTo
(
2
);
posts
.
Count
.
IsEqualTo
(
3
);
((
int
)
users
.
First
().
Id
).
IsEqualTo
(
2
);
((
int
)
posts
.
First
().
Id
).
IsEqualTo
(
3
);
}
finally
{
connection
.
Execute
(
"drop table #Users drop table #Posts"
);
}
}
[
Fact
]
public
void
Issue268_ReturnQueryMultiple
()
{
connection
.
Execute
(
@"create proc #TestProc268 (@a int, @b int, @c int)as
begin
select @a;
select @b
return @c;
end"
);
var
p
=
new
DynamicParameters
(
new
{
a
=
1
,
b
=
2
,
c
=
3
});
p
.
Add
(
"RetVal"
,
dbType
:
DbType
.
Int32
,
direction
:
ParameterDirection
.
ReturnValue
);
using
(
var
reader
=
connection
.
QueryMultiple
(
"#TestProc268"
,
p
,
commandType
:
CommandType
.
StoredProcedure
))
{
reader
.
Read
();
}
var
retVal
=
p
.
Get
<
int
>(
"RetVal"
);
retVal
.
IsEqualTo
(
3
);
}
}
}
Dapper.DNX.Tests/Tests.cs
浏览文件 @
583f98f6
此差异已折叠。
点击以展开。
Dapper.DNX.Tests/project.json
浏览文件 @
583f98f6
...
...
@@ -11,26 +11,32 @@
"target"
:
"project"
}
},
"commands"
:
{
"Dapper.DNX.Tests"
:
"Dapper.DNX.Tests"
"Dapper.DNX.Tests"
:
"Dapper.DNX.Tests"
,
"test"
:
"xunit.runner.dnx"
},
"frameworks"
:
{
"net45"
:
{
"compilationOptions"
:
{
"define"
:
[
],
"define"
:
[
"ASYNC"
],
"warningsAsErrors"
:
true
},
"frameworkAssemblies"
:
{
"System.Data"
:
"4.0.0.0"
,
"System.Runtime"
:
"4.0.0.0"
,
"System.Xml"
:
"4.0.0.0"
},
"dependencies"
:
{
"xunit"
:
"2.1.0"
}
},
"net40"
:
{
"frameworkAssemblies"
:
{
"System.Data"
:
"4.0.0.0"
,
"System.Xml"
:
"4.0.0.0"
},
"dependencies"
:
{
"xunit"
:
"1.9.2"
}
},
"dotnet5.2"
:
{
...
...
@@ -44,7 +50,26 @@
"System.Console"
:
"4.0.0-beta-23409"
,
"System.Data.SqlClient"
:
"4.0.0-beta-23225"
,
"System.Linq"
:
"4.0.1-beta-23225"
,
"System.Threading"
:
"4.0.11-beta-23225"
"System.Threading"
:
"4.0.11-beta-23225"
,
"xunit"
:
"2.1.0"
}
},
"dnx451"
:
{
"compilationOptions"
:
{
"define"
:
[
"ASYNC"
]
},
"dependencies"
:
{
"xunit"
:
"2.1.0"
,
"xunit.runner.dnx"
:
"2.1.0-rc1-build204"
}
},
"dnxcore50"
:
{
"compilationOptions"
:
{
"define"
:
[
"DOTNET5_2"
,
"ASYNC"
]
},
"dependencies"
:
{
"xunit"
:
"2.1.0"
,
"xunit.runner.dnx"
:
"2.1.0-rc1-build204"
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录