I am trying to throw exception when unsubscribing from event.
.NET Framework 4.8
I tried this:
var sFE = NSubstitute.Substitute.For<System.Windows.FrameworkElement>();
sFE.When(x => x.SizeChanged -= Arg.Any<System.Windows.SizeChangedEventHandler>())
.Do(x =>
{
throw new System.MissingMethodException();
});
But I get error: System.ArgumentNullException: 'Value cannot be null. Parameter name: handler'
Please can you help me?