コード例 #1
0
        /// <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);
        }
コード例 #2
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged
 /// resources.
 /// </summary>
 public void Dispose()
 {
     UnitTestingLoggingProvider.UnregisterThreadStaticLogger();
 }