The issue is that PropertyChanged is declared as "event PropertyChangedEventHandler", where PropertyChangedEventHandler is a delegate rather than something which inherits from EventHander.
We're working on trying to find a good syntax to raise events declared like this, and it will hopefully be in the repo in the next day or two. Until then you can force NSubstitute to use the correct Raise.Event overload like this:
[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);
}
( If you're interested in the source, this is the overload that currently lives here:
http://bit.ly/c618MJ )
Appreciate you sending this through; it's a much more obvious example than the previous one we'd found. :)
Regards,
David