This is a migrated thread and some comments may be shown as answers.

Mocking increment/decrement operator on event handlers

1 Answer 158 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 23 Feb 2012, 10:33 AM
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.

1 Answer, 1 is accepted

Sort by
0
Ricky
Telerik team
answered on 27 Feb 2012, 03:56 PM
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 >>
Tags
General Discussions
Asked by
Scott
Top achievements
Rank 1
Answers by
Ricky
Telerik team
Share this question
or