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?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…