G
Guest
Please can you show me how to unit test the following class...
Friend Delegate Sub Delegate1()
Friend Class Class1
Private m_Delegate1 As Delegate1
Friend WriteOnly Property Delegate1() As Delegate1
Set(ByVal value As Delegate1)
Me.m_Delegate1 = value
End Set
End Property
Friend Sub Sub1()
Me.m_Delegate1.Invoke()
End Sub
End Class
I want my test to look something like this...
Public Sub Test()
Dim target As Object = Class1Accessor.CreatePrivate
Dim val As Delegate1Accessor = New Delegate1Accessor(AddressOf MySub)
Dim accessor As Class1Accessor = New Class1Accessor(target)
accessor.Delegate1 = val
accessor.Sub1()
End Sub
Public Sub MySub()
Stop
End Sub
Friend Delegate Sub Delegate1()
Friend Class Class1
Private m_Delegate1 As Delegate1
Friend WriteOnly Property Delegate1() As Delegate1
Set(ByVal value As Delegate1)
Me.m_Delegate1 = value
End Set
End Property
Friend Sub Sub1()
Me.m_Delegate1.Invoke()
End Sub
End Class
I want my test to look something like this...
Public Sub Test()
Dim target As Object = Class1Accessor.CreatePrivate
Dim val As Delegate1Accessor = New Delegate1Accessor(AddressOf MySub)
Dim accessor As Class1Accessor = New Class1Accessor(target)
accessor.Delegate1 = val
accessor.Sub1()
End Sub
Public Sub MySub()
Stop
End Sub