Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raising delegate as an event. #20

Closed
rodrigoelp opened this issue Jul 23, 2010 · 1 comment
Closed

Raising delegate as an event. #20

rodrigoelp opened this issue Jul 23, 2010 · 1 comment

Comments

@rodrigoelp
Copy link

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.
    }
}

}

@AnthonyEgerton
Copy link
Member

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants