我知道如何在 C# 中做到这一点:(来自文档)
view.Raise(x => x.Load += null, this, EventArgs.Empty);
我尝试了以下方法:
Me.MockObject.Raise(Sub(x) x.SomeEvent(), someArgs)
'Compiler Error:
'SomeEvent is an event, and cannot be called directly.
'Use a RaiseEvent statement to raise an event.
我尝试用...替换Sub(x)
...Function(x)
也没有运气。所以尝试了:
Me.MockObject.Raise(Sub(x) x.SomeEvent(), someArgs)
'Compiler Error
'x is not an event of MyTestFixtureClass
哎呀...
我似乎无法在 VB.NET 中弄清楚...有什么提示吗?