0
|
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 }
|