I'm working on writing unit tests for a component that utilizes reading/writing to the Windows Event Log and am having trouble wrapping my head around how to best mock this if my goal is to remove external dependencies (reading and writing to the actual event log).
The component uses EventLogWatcher to subscribe to events such that the event EventRecordWritten is raised when a specific event is published to the event log and my ReadEventLog() delegate function handles logic relating to the newly published event.
My objective in this unit test has been to ultimately test the functionality of ReadEventLog() but I fail to see how to raise the EventRecordWritten event myself so that ReadEventLog() gets called.
I'm looking for any advice on how to properly write unit tests for the Event Log so that I'm not actually writing to the event log but still somehow using my existing ReadEventLog() delegate function(since that's the logic I need to test).