comparison HowTo/Data/ExecuteScalarList.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 ExecuteScalarList
14 {
15 List<string> GetNameList1()
16 {
17 using (DbManager db = new DbManager())
18 {
19 return db
20 .SetCommand("SELECT FirstName FROM Person")
21 ./*[a]*/ExecuteScalarList/*[/a]*/<string>();
22 }
23 }
24
25 [Test]
26 public void Test1()
27 {
28 List<string> list = GetNameList1();
29
30 Assert.AreNotEqual(0, list.Count);
31 Assert.IsNotNull(list[0]);
32 }
33
34 List<string> GetNameList2()
35 {
36 using (DbManager db = new DbManager())
37 {
38 return db
39 .SetCommand("SELECT * FROM Person")
40 ./*[a]*/ExecuteScalarList/*[/a]*/<string>(/*[a]*/"FirstName"/*[/a]*/);
41 }
42 }
43
44 [Test]
45 public void Test2()
46 {
47 List<string> list = GetNameList2();
48
49 Assert.AreNotEqual(0, list.Count);
50 Assert.IsNotNull(list[0]);
51 }
52 }
53 }