There is an interesting discussion in question 1129517 around how to do this very thing in C#.
Since the class that contains the Event was written in C#, the delegate semantics do apply, and those techniques should work for you. However, you'll need to translate the source to VB.NET for your unit test.
Given the following class in a C# assembly:
public class Triggerific
{
public event EventHandler Trigger;
private static void OnTriggerTriggered(object sender, EventArgs e)
{
Console.WriteLine("Triggered!");
}
public void AddTrigger()
{
Trigger += OnTriggerTriggered;
}
}
Here is some VB.NET code which will correctly determine if a handler was registered for the Trigger event:
<TestMethod()> _
Public Sub TriggerTest()
Dim cut As New Triggerific
cut.AddTrigger()
Assert.IsNotNull(GetEventHandler(cut, "Trigger"))
End Sub
Private Shared Function GetEventHandler(ByVal classInstance As Object, ByVal eventName As String) As EventHandler
Dim classType As Type = classInstance.[GetType]()
Dim eventField As FieldInfo = classType.GetField(eventName, BindingFlags.GetField Or BindingFlags.NonPublic Or BindingFlags.Instance)
Dim eventDelegate As EventHandler = DirectCast(eventField.GetValue(classInstance), EventHandler)
' eventDelegate will be null/Nothing if no listeners are attached to the event
Return eventDelegate
End Function