0
|
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 }
|