private bool PassLogFilter(LogEntry logEntry) { if (string.IsNullOrEmpty(LogFilter) || LogFilter.Equals(_defaultComboBoxItem)) { return(true); } return(logEntry.Message.IndexOf(LogFilter, StringComparison.OrdinalIgnoreCase) >= 0); }
public void CombineLogTests() { LogFilter f = new LogFilter(LogLevelFilter.None, LogLevelFilter.Error); LogFilter f2 = f.SetGroup(LogLevelFilter.Info); Assert.That(f2.Line == LogLevelFilter.Error && f2.Group == LogLevelFilter.Info); LogFilter f3 = new LogFilter(LogLevelFilter.Trace, LogLevelFilter.Info); LogFilter f4 = f2.Combine(f3); Assert.That(f4.Equals(f3)); Assert.That(f4 == f3); }