comparison Examples/VB/OverloadWithDefValue.vb @ 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 ''@ 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