comparison HowTo/DataAccess/DataSetTable.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.Data;
3
4 using NUnit.Framework;
5
6 using BLToolkit.DataAccess;
7
8 namespace HowTo.DataAccess
9 {
10 [TestFixture]
11 public class DataSetTable
12 {
13 public abstract class TestAccessor : DataAccessor
14 {
15 [SprocName("Person_SelectAll"), /*[a]*/DataSetTable/*[/a]*/("First")]
16 public abstract void SelectFirstTable ([Destination] DataSet ds);
17
18 [SprocName("Person_SelectAll"), /*[a]*/DataSetTable/*[/a]*/("Second")]
19 public abstract void SelectSecondTable ([Destination] DataSet ds);
20
21 [SprocName("Person_SelectAll"), /*[a]*/DataSetTable/*[/a]*/(0)]
22 public abstract void SelectFirstTable2 ([Destination] DataSet ds);
23
24 [SprocName("Person_SelectAll"), /*[a]*/DataSetTable/*[/a]*/(1)]
25 public abstract void SelectSecondTable2([Destination] DataSet ds);
26 }
27
28 [Test]
29 public void Test()
30 {
31 TestAccessor ta = DataAccessor.CreateInstance<TestAccessor>();
32
33 DataSet ds = new DataSet();
34
35 ta.SelectFirstTable (ds);
36 ta.SelectSecondTable (ds);
37 ta.SelectFirstTable2 (ds);
38 ta.SelectSecondTable2(ds);
39
40 Assert.IsTrue (ds.Tables.Contains("First"), "Table 'First' not found");
41 Assert.IsTrue (ds.Tables.Contains("Second"), "Table 'Second' not found");
42 Assert.IsFalse(ds.Tables.Contains("Table"), "Table 'Table' was found");
43 }
44 }
45 }