Skip to content
makolyte

makolyte

Solve real coding problems

  • About
  • C#
  • SQL

mock-raise

C# – Unit test an event handler

05/24/202412/27/2020 by Mak

An event handler is a method that is registered to listen to an event. When the event is invoked, the event handler method is called. You may be tempted to directly call the event handler to unit test it. It’s better to actually raise the event though, and then check the side effects of the … Read more

Categories C# Tags event, interface, mock, mock-raise, mock-verify, moq, targetparametercountexception, unit-testing
About โ€ข Privacy Policy
© 2025 makolyte