Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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);
        }