/// <summary>Initializes a new instance of the <see cref="LoggingProviderScope"/> class.</summary> public LoggingProviderScope() { var entries = new List <LogEntry>(); this.loggedEntries = new ReadOnlyCollection <LogEntry>(entries); var logger = new ActionLoggingProvider((entry) => { entries.Add(entry); ValidateEntries(entries); }); UnitTestingLoggingProvider.RegisterThreadStaticLogger(logger); }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged /// resources. /// </summary> public void Dispose() { UnitTestingLoggingProvider.UnregisterThreadStaticLogger(); }