0
|
1 using System;
|
|
2
|
|
3 using NUnit.Framework;
|
|
4
|
|
5 using BLToolkit.Aspects;
|
|
6 using BLToolkit.DataAccess;
|
|
7 using BLToolkit.Reflection;
|
|
8
|
|
9 namespace Aspects
|
|
10 {
|
|
11 [TestFixture]
|
|
12 public class AsyncAndDataAccessorTest
|
|
13 {
|
|
14 public abstract class TestObject : DataAccessor
|
|
15 {
|
|
16 [SqlQuery("SELECT @intVal")]
|
|
17 public abstract int Test(int @intVal);
|
|
18
|
|
19 [Async] public abstract IAsyncResult BeginTest(int intVal);
|
|
20 [Async] public abstract int EndTest(IAsyncResult asyncResult);
|
|
21 }
|
|
22
|
|
23 [Test]
|
|
24 public void Test()
|
|
25 {
|
|
26 TestObject o = TypeAccessor<TestObject>.CreateInstance();
|
|
27
|
|
28 IAsyncResult ar = o.BeginTest(42);
|
|
29 Assert.AreEqual(42, o.EndTest(ar));
|
|
30 }
|
|
31 }
|
|
32 }
|