public void TestTryGetNonExistentAnalyser() { var activeAnalysis = new ActiveAnalysis(AnalysisId.CreateNew(), _template, _taskScheduler, _dataSourceAnalyserEngine, TimeSpan.Zero); _template.Analysers.Should().BeEmpty(); var configuration = new Mock <ILogAnalyserConfiguration>().Object; activeAnalysis.Add(new AnalyserPluginId("foobar"), configuration); activeAnalysis.TryGetAnalyser(AnalyserId.CreateNew(), out var actualAnalyser).Should().BeFalse(); actualAnalyser.Should().BeNull(); }
public void TestTryGetAnalyser() { var activeAnalysis = new ActiveAnalysis(AnalysisId.CreateNew(), _template, _taskScheduler, _analysisEngine.Object, TimeSpan.Zero); _template.Analysers.Should().BeEmpty(); var configuration = new Mock <ILogAnalyserConfiguration>().Object; var analyser = activeAnalysis.Add(new LogAnalyserFactoryId("foobar"), configuration); activeAnalysis.TryGetAnalyser(analyser.Id, out var actualAnalyser).Should().BeTrue(); actualAnalyser.Should().BeSameAs(analyser); }