comparison UnitTests/CS/Aspects/AsyncAndDataAccessorTest.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
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 }