comparison HowTo/DataAccess/ParamNullValue.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 NUnit.Framework;
3 using BLToolkit.DataAccess;
4
5 namespace HowTo.DataAccess
6 {
7 [TestFixture]
8 public class ParamNullValue
9 {
10 public abstract class TestAccessor : DataAccessor
11 {
12 public abstract Person SelectByKey([/*[a]*/ParamNullValue/*[/a]*/(1)] int id);
13 }
14
15 [Test]
16 public void Test()
17 {
18 TestAccessor ta = DataAccessor.CreateInstance<TestAccessor>();
19
20 // Parameter id == 1 will be replaced with NULL
21 //
22 Person p1 = ta.SelectByKey(1);
23 Assert.IsNull(p1);
24
25 // Parameter id == 2 will be send as is
26 //
27 Person p2 = ta.SelectByKey(2);
28 Assert.IsNotNull(p2);
29 }
30 }
31 }