Mocking increment/decrement operator on event handlers

2 posts, 0 answers
  1. Scott
    Scott avatar
    3 posts
    Member since:
    Feb 2012

    Posted 23 Feb 2012 Link to this post

    Is there a way to mock the increment/decrement operators?


    MyEventHandler += HandlerToAdd;
    MyEventHandler -= HandlerToSubtrack;

    It seems the typical property mocking doesn't work here.
  2. Ricky
    Ricky avatar
    467 posts

    Posted 27 Feb 2012 Link to this post

    Hi Scott,

    Thanks again for contacting us. From the above example it looks to me that you are trying to mock event handlers.

    Please take a look into the following posts on how you can mock events using JustMock.
    In addition, if you have a specific sample in mind then you can also send it out to me. I will take a further look.

    Kind Regards,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top