Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Dapper
提交
af4cd5e7
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,发现更多精彩内容 >>
提交
af4cd5e7
编写于
4月 26, 2011
作者:
S
Sam Saffron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleanup test so its less abstract
上级
db08e25d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
39 addition
and
33 deletion
+39
-33
Tests/Tests.cs
Tests/Tests.cs
+39
-33
未找到文件。
Tests/Tests.cs
浏览文件 @
af4cd5e7
...
...
@@ -322,39 +322,45 @@ public void TestMultiMapDynamic()
public
void
TestMultiMappingVariations
()
{
var
sql
=
"select 1 as Id, 'a' as Content, 2 as Id, 'b' as Content, 3 as Id, 'c' as Content, 4 as Id, 'd' as Content, 5 as Id, 'e' as Content"
;
var
mapped
=
connection
.
Query
<
dynamic
,
dynamic
,
dynamic
>(
sql
,
(
a
,
b
,
c
)
=>
{
a
.
B
=
b
;
a
.
C
=
c
;
}).
First
();
Assert
.
IsEqualTo
(
mapped
.
Id
,
1
);
Assert
.
IsEqualTo
(
mapped
.
Content
,
"a"
);
Assert
.
IsEqualTo
(
mapped
.
B
.
Id
,
2
);
Assert
.
IsEqualTo
(
mapped
.
B
.
Content
,
"b"
);
Assert
.
IsEqualTo
(
mapped
.
C
.
Id
,
3
);
Assert
.
IsEqualTo
(
mapped
.
C
.
Content
,
"c"
);
mapped
=
connection
.
Query
<
dynamic
,
dynamic
,
dynamic
,
dynamic
>(
sql
,
(
a
,
b
,
c
,
d
)
=>
{
a
.
B
=
b
;
a
.
C
=
c
;
a
.
C
.
D
=
d
;
}).
First
();
Assert
.
IsEqualTo
(
mapped
.
Id
,
1
);
Assert
.
IsEqualTo
(
mapped
.
Content
,
"a"
);
Assert
.
IsEqualTo
(
mapped
.
B
.
Id
,
2
);
Assert
.
IsEqualTo
(
mapped
.
B
.
Content
,
"b"
);
Assert
.
IsEqualTo
(
mapped
.
C
.
Id
,
3
);
Assert
.
IsEqualTo
(
mapped
.
C
.
Content
,
"c"
);
Assert
.
IsEqualTo
(
mapped
.
C
.
D
.
Id
,
4
);
Assert
.
IsEqualTo
(
mapped
.
C
.
D
.
Content
,
"d"
);
mapped
=
connection
.
Query
<
dynamic
,
dynamic
,
dynamic
,
dynamic
,
dynamic
>(
sql
,
(
a
,
b
,
c
,
d
,
e
)
=>
{
a
.
B
=
b
;
a
.
C
=
c
;
a
.
C
.
D
=
d
;
a
.
E
=
e
;
}).
First
();
Assert
.
IsEqualTo
(
mapped
.
Id
,
1
);
Assert
.
IsEqualTo
(
mapped
.
Content
,
"a"
);
Assert
.
IsEqualTo
(
mapped
.
B
.
Id
,
2
);
Assert
.
IsEqualTo
(
mapped
.
B
.
Content
,
"b"
);
Assert
.
IsEqualTo
(
mapped
.
C
.
Id
,
3
);
Assert
.
IsEqualTo
(
mapped
.
C
.
Content
,
"c"
);
Assert
.
IsEqualTo
(
mapped
.
C
.
D
.
Id
,
4
);
Assert
.
IsEqualTo
(
mapped
.
C
.
D
.
Content
,
"d"
);
Assert
.
IsEqualTo
(
mapped
.
E
.
Id
,
5
);
Assert
.
IsEqualTo
(
mapped
.
E
.
Content
,
"e"
);
var
sql
=
@"select 1 as Id, 'a' as Content, 2 as Id, 'b' as Content, 3 as Id, 'c' as Content, 4 as Id, 'd' as Content, 5 as Id, 'e' as Content"
;
var
order
=
connection
.
Query
<
dynamic
,
dynamic
,
dynamic
>(
sql
,
(
o
,
owner
,
creator
)
=>
{
o
.
Owner
=
owner
;
o
.
Creator
=
creator
;
}).
First
();
Assert
.
IsEqualTo
(
order
.
Id
,
1
);
Assert
.
IsEqualTo
(
order
.
Content
,
"a"
);
Assert
.
IsEqualTo
(
order
.
Owner
.
Id
,
2
);
Assert
.
IsEqualTo
(
order
.
Owner
.
Content
,
"b"
);
Assert
.
IsEqualTo
(
order
.
Creator
.
Id
,
3
);
Assert
.
IsEqualTo
(
order
.
Creator
.
Content
,
"c"
);
order
=
connection
.
Query
<
dynamic
,
dynamic
,
dynamic
,
dynamic
>(
sql
,
(
o
,
owner
,
creator
,
address
)
=>
{
o
.
Owner
=
owner
;
o
.
Creator
=
creator
;
o
.
Owner
.
Address
=
address
;
}).
First
();
Assert
.
IsEqualTo
(
order
.
Id
,
1
);
Assert
.
IsEqualTo
(
order
.
Content
,
"a"
);
Assert
.
IsEqualTo
(
order
.
Owner
.
Id
,
2
);
Assert
.
IsEqualTo
(
order
.
Owner
.
Content
,
"b"
);
Assert
.
IsEqualTo
(
order
.
Creator
.
Id
,
3
);
Assert
.
IsEqualTo
(
order
.
Creator
.
Content
,
"c"
);
Assert
.
IsEqualTo
(
order
.
Owner
.
Address
.
Id
,
4
);
Assert
.
IsEqualTo
(
order
.
Owner
.
Address
.
Content
,
"d"
);
order
=
connection
.
Query
<
dynamic
,
dynamic
,
dynamic
,
dynamic
,
dynamic
>(
sql
,
(
a
,
b
,
c
,
d
,
e
)
=>
{
a
.
B
=
b
;
a
.
C
=
c
;
a
.
C
.
D
=
d
;
a
.
E
=
e
;
}).
First
();
Assert
.
IsEqualTo
(
order
.
Id
,
1
);
Assert
.
IsEqualTo
(
order
.
Content
,
"a"
);
Assert
.
IsEqualTo
(
order
.
B
.
Id
,
2
);
Assert
.
IsEqualTo
(
order
.
B
.
Content
,
"b"
);
Assert
.
IsEqualTo
(
order
.
C
.
Id
,
3
);
Assert
.
IsEqualTo
(
order
.
C
.
Content
,
"c"
);
Assert
.
IsEqualTo
(
order
.
C
.
D
.
Id
,
4
);
Assert
.
IsEqualTo
(
order
.
C
.
D
.
Content
,
"d"
);
Assert
.
IsEqualTo
(
order
.
E
.
Id
,
5
);
Assert
.
IsEqualTo
(
order
.
E
.
Content
,
"e"
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录