0
|
1 using System;
|
|
2 using System.Collections.Generic;
|
|
3
|
|
4 using NUnit.Framework;
|
|
5
|
|
6 using BLToolkit.DataAccess;
|
|
7
|
|
8 namespace HowTo.DataAccess
|
|
9 {
|
|
10 [TestFixture]
|
|
11 public class Format
|
|
12 {
|
|
13 public abstract class PersonAccessor : DataAccessor
|
|
14 {
|
|
15 [SqlQuery("SELECT TOP {0} * FROM Person")]
|
|
16 public abstract List<Person> GetPersonList([/*[a]*/Format/*[/a]*/] int top);
|
|
17 }
|
|
18
|
|
19 [Test]
|
|
20 public void Test()
|
|
21 {
|
|
22 PersonAccessor pa = DataAccessor.CreateInstance<PersonAccessor>();
|
|
23 List<Person> list = pa.GetPersonList(2);
|
|
24
|
|
25 Assert.That(list, Is.Not.Null);
|
|
26 Assert.That(list.Count, Is.LessThanOrEqualTo(2));
|
|
27 }
|
|
28 }
|
|
29 }
|