jonwagner / EventSourceProxy

EventSourceProxy (ESP) is the easiest way to add scalable Event Tracing for Windows (ETW) logging to your .NET program
Other
97 stars 20 forks source link

Unit testing support for TraceParameterProvider extensions needs improvement #53

Closed tillig closed 3 years ago

tillig commented 8 years ago

I'm writing an extension that I want to use to add some dynamic context to events using the TraceParameterProvider mechanism as outlined on the wiki.

I'd like to unit test this to verify it works. Ideally that would mean creating a TraceParameterProvider that is scoped only to the unit test, attaching that to a generated proxy, capturing a log event, and verifying that the provider added the information desired.

Unfortuantely, I'm finding that to be challenging, if not impossible.

In production, I'll be using the TraceParameterProvider.Default to attach the extension I'm writing. In unit testing, I don't want to corrupt or change the global static state.

The simplest solution would be to make TypeImplementer a public type. Would you be willing to accept a pull request for that one-line change?

jonwagner commented 3 years ago

Added in 4.0.0.