public void SetUp() { _traceEventTypeAdapter = A.Fake <IAdapter <Severity, TraceEventType> >(); _entryFormatter = A.Fake <IEntryFormatter>(); _logEntryFactory = A.Fake <ILogEntryFactory>(); _sut = new TraceLogger(SourceName, _traceEventTypeAdapter, _entryFormatter, _logEntryFactory); }
/// <summary> /// Initializes a new TraceLogger /// </summary> /// <param name="traceSourceName"> /// The name of the corresponding <see cref="TraceSource"/> /// This should match the name specified in /// web.config/app.config /// | /// -- system.diagnostics /// | /// -- sources /// | /// -- source name = "..." /// </param> public TraceLogger( string traceSourceName, IAdapter <Severity, TraceEventType> traceEventTypeAdapter, IEntryFormatter entryFormatter, ILogEntryFactory logEntryFactory) { if (traceSourceName == null) { throw new ArgumentNullException(nameof(traceSourceName)); } if (traceEventTypeAdapter == null) { throw new ArgumentNullException(nameof(traceEventTypeAdapter)); } if (entryFormatter == null) { throw new ArgumentNullException(nameof(entryFormatter)); } if (logEntryFactory == null) { throw new ArgumentNullException(nameof(logEntryFactory)); } _traceSource = new TraceSource(traceSourceName); _traceEventTypeAdapter = traceEventTypeAdapter; _entryFormatter = entryFormatter; _logEntryFactory = logEntryFactory; }
public AutoRegistrationPlugin(ISynchronizer synchronizer, IRegistrationRepository registrationRepository, IPageRepository pageRepository, IPageFormatter pageFormatter, IEntryFormatter entryFormatter, INotificationSender notificationSender, ILogger logger, IPluginConfiguration configuration, IFileReader fileReader, ISettings settings) { _synchronizer = synchronizer; _fileReader = fileReader; _settings = settings; _registrationRepository = registrationRepository; _pageRepository = pageRepository; _pageFormatter = pageFormatter; _entryFormatter = entryFormatter; _notificationSender = notificationSender; _logger = logger; _configuration = configuration; }