public FileLogEntryController(Invoker dispatcher = null, Func<string, LogEntryParser, ILogFileWatcher<LogEntry>> createLogFileWatcher = null, IPersist persist = null)
 {
     Entries = new ObservableCollection<LogEntryViewModel>();
     this.watcherFactory = createLogFileWatcher??CreateLogFileWatcher;
     wrappedDispatcher = dispatcher ?? new WrappedDispatcher().Invoke;
     Counter = new LogEntryCounter(Entries);
     this.recentFileList = new RecentFileList(persist?? new XmlPersister(ApplicationAttributes.Get(),9));
 }
 public FileLogEntryController(Invoker dispatcher = null, Func <string, LogEntryParser, ILogFileWatcher <LogEntry> > createLogFileWatcher = null, IPersist persist = null)
 {
     Entries             = new ObservableCollection <LogEntryViewModel>();
     this.watcherFactory = createLogFileWatcher ?? CreateLogFileWatcher;
     wrappedDispatcher   = dispatcher ?? new WrappedDispatcher().Invoke;
     Counter             = new LogEntryCounter(Entries);
     this.recentFileList = new RecentFileList(persist ?? new XmlPersister(ApplicationAttributes.Get(), 9));
 }
 public void Can_count()
 {
     var col = new ObservableCollection<LogVmT>(new []{
         LogVm(Level.Error), LogVm(Level.Error),
         LogVm(Level.Info)
     });
     var counter = new LogEntryCounter(col);
     Assert.Equal(LCount(Kv("ERROR",2), Kv("INFO",1)), counter.Count.Value);
 }
 public void Can_clear()
 {
     var col = new ObservableCollection<LogVmT>(new[]{
         LogVm(Level.Error), LogVm(Level.Error),
         LogVm(Level.Info)
     });
     var counter = new LogEntryCounter(col);
     col.Clear();
     Assert.Equal(LCount(),counter.Count.Value);
 }