You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can force an overload to be called that returns delegatecallwrapper:
[Test]
public void CanRaiseNotifyPropertyChangedEvent()
{
var sub = Substitute.For<INotifyPropertyChanged>();
var wasRaised = false;
sub.PropertyChanged += (sender, args) => wasRaised = true;
sub.PropertyChanged += Raise.Event<PropertyChangedEventHandler>(this, new PropertyChangedEventArgs("test"));
Assert.That(wasRaised);
}
Probably need a more obvious way to calls these (possibly with arg defaults/detection?). Unfortunately generic constraints can't constrain to delegate types, so may need to introduce Raise.DelegateEvent(...) or similar.
Another option is to make the current arg defaulting more robust, and let the dev cast the delegate to the correct type (adding cast to EventHandlerWrapper).
Event is declared as delegate (i.e. not an EventHandler). So can't use Raise.Action or Raise.Event.
Another example is:
_AppDomain.UnhandledException event
The text was updated successfully, but these errors were encountered: