public void TestAnalyseEmpty() { var analyser = new LogEntryCountAnalyser(_scheduler, _logFile, TimeSpan.Zero, new LogEntryCountAnalyserConfiguration()); _scheduler.RunOnce(); analyser.Result.Should().NotBeNull(); analyser.Result.Should().BeOfType <LogEntryCountResult>(); ((LogEntryCountResult)analyser.Result).Count.Should().Be(0); }
public void TestAnalyseOneEntry() { _logFile.AddEntry("foobar", LevelFlags.All); var analyser = new LogEntryCountAnalyser(_scheduler, _logFile, TimeSpan.Zero, new LogEntryCountAnalyserConfiguration()); _scheduler.RunOnce(); analyser.Result.Should().NotBeNull(); analyser.Result.Should().BeOfType <LogEntryCountResult>(); ((LogEntryCountResult)analyser.Result).Count.Should().Be(1); }
public void TestDispose1() { var analyser = new LogEntryCountAnalyser(_scheduler, _logFile, TimeSpan.Zero, new LogEntryCountAnalyserConfiguration()); analyser.Dispose(); _logFile.AddEntry("foobar", LevelFlags.All); ((LogEntryCountResult)analyser.Result).Count.Should().Be(0, "because the analyser shouldn't have reacted to the modification after it has been disposed of"); _scheduler.PeriodicTaskCount.Should() .Be(0, "because after the analyser has been disposed of, no tasks should be left running"); }
public void TestAnalyseFiltered() { _logFile.AddEntry("foobar", LevelFlags.All); var analyser = new LogEntryCountAnalyser(_scheduler, _logFile, TimeSpan.Zero, new LogEntryCountAnalyserConfiguration { QuickFilters = { new QuickFilter { Value = "f**k this shit", MatchType = FilterMatchType.SubstringFilter } } }); _scheduler.RunOnce(); ((LogEntryCountResult)analyser.Result).Count.Should().Be(0, "because the one entry doesn't match the configured filter"); }