0
|
1 ''@ example:
|
|
2 ''@ emit Emit
|
|
3 Imports System
|
|
4 Imports BLToolkit.Aspects
|
|
5 Imports NUnit.Framework
|
|
6
|
|
7 Imports BLToolkit.Reflection
|
|
8
|
|
9 Namespace Examples
|
|
10
|
|
11 <TestFixture()> _
|
|
12 Public Class OverloadWithDefValue
|
|
13
|
|
14 Public MustInherit Class TestObject
|
|
15
|
|
16 Public Sub TestMethod( _
|
|
17 ByVal passthrough As Integer, _
|
|
18 Optional ByVal strVal As String = "str", _
|
|
19 Optional ByVal intVal As Integer = 123)
|
|
20 Assert.AreEqual(321, passthrough)
|
|
21 Assert.AreEqual("str", strVal)
|
|
22 Assert.AreEqual(123, intVal)
|
|
23 End Sub
|
|
24
|
|
25 <Overload()> _
|
|
26 Public MustOverride Sub TestMethod( _
|
|
27 ByVal passthrough As Integer, _
|
|
28 ByVal dateVal As Date)
|
|
29
|
|
30 End Class
|
|
31
|
|
32 <Test()> _
|
|
33 Sub Test()
|
|
34 Dim o As TestObject = TypeAccessor(Of TestObject).CreateInstance
|
|
35 o.TestMethod(321, Today)
|
|
36 End Sub
|
|
37
|
|
38 End Class
|
|
39
|
|
40 End Namespace
|