Mercurial > pub > bltoolkit
comparison HowTo/Data/ExecuteScalarDictionary.cs @ 0:f990fcb411a9
Копия текущей версии из github
author | cin |
---|---|
date | Thu, 27 Mar 2014 21:46:09 +0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f990fcb411a9 |
---|---|
1 using System; | |
2 using System.Collections.Generic; | |
3 | |
4 using NUnit.Framework; | |
5 | |
6 using BLToolkit.Data; | |
7 | |
8 namespace HowTo.Data | |
9 { | |
10 using DataAccess; | |
11 | |
12 [TestFixture] | |
13 public class ExecuteScalarDictionary | |
14 { | |
15 Dictionary<int, string> GetNameDictionary() | |
16 { | |
17 using (DbManager db = new DbManager()) | |
18 { | |
19 return db | |
20 .SetCommand("SELECT * FROM Person") | |
21 ./*[a]*/ExecuteScalarDictionary/*[/a]*/<int, string>(/*[a]*/"PersonID"/*[/a]*/, /*[a]*/"FirstName"/*[/a]*/); | |
22 } | |
23 } | |
24 | |
25 [Test] | |
26 public void Test() | |
27 { | |
28 Dictionary<int, string> dic = GetNameDictionary(); | |
29 | |
30 Assert.AreNotEqual(0, dic.Count); | |
31 Assert.IsNotNull(dic[1]); | |
32 } | |
33 } | |
34 } |