public void Handle_with_ClusterOpenedEvent_should_trace_event() { const string traceSourceName = "Handle_with_ClusterOpenedEvent_should_trace_event"; const string logFileName = traceSourceName + "-log"; var @event = new ClusterOpenedEvent(new ClusterId(), new ClusterSettings(), new TimeSpan(1)); var expectedLogMessage = $"{TraceSourceEventHelper.Label(@event.ClusterId)}: opened in {@event.Duration.TotalMilliseconds}ms."; var traceSource = CreateTraceSource(logFileName, logFileName); var subject = new TraceSourceSdamEventSubscriber(traceSource); subject.Handle(@event); var log = ReadLog(traceSource, logFileName); log.Should().Contain(expectedLogMessage); }
public static void Handle(this TraceSourceSdamEventSubscriber subject, ClusterOpenedEvent @event) => Reflector.Invoke(subject, "Handle", @event);