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
Trying to raise a custom event handler definition I got a compilation error. The following code illustrates the issue.
namespace NSubstitute.Issue
{
public delegate void WeirdHandler(WeirdEventArgs args);
public interface ISomething
{
event WeirdHandler SomethingHappened;
}
public class WeirdEventArgs
{
}
public class Scenario
{
private ISomething _something;
[SetUp]
public void Setup()
{
_something = Substitute.For<ISomething>();
_something.SomethingHappened += Raise.Event(new WeirdEventArgs());//This won't compile
}
[Test]
public void ShouldDoSomethingInResponseToTheEvent()
{
////left in blank for your imagination.
}
}
}
The text was updated successfully, but these errors were encountered:
Trying to raise a custom event handler definition I got a compilation error. The following code illustrates the issue.
namespace NSubstitute.Issue
{
public delegate void WeirdHandler(WeirdEventArgs args);
}
The text was updated successfully, but these errors were encountered: