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?

    Example:

    MyEventHandler += HandlerToAdd;
    MyEventHandler -= HandlerToSubtrack;

    It seems the typical property mocking doesn't work here.
  2. Ricky
    Admin
    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.

    http://www.telerik.com/help/justmock/basic-usage-mock-raise.html
    http://www.telerik.com/help/justmock/basic-usage-mock-raises.html
     
    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,
    Mehfuz
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft R3 2016 release webinar banner
Back to Top