public void TestVersionOutput() { var testWriterFactory = new TestWriterFactory(); var processNotificationCollector = new ProcessingNotificationsCollector(10); using (var plugin = new LogShark.Plugins.Config.ConfigPlugin()) { plugin.Configure(testWriterFactory, null, processNotificationCollector, new NullLoggerFactory()); plugin.ProcessLogLine(_workgroupYamlWithVersionInfo.GetLogLine(), _workgroupYamlWithVersionInfo.LogType); var pluginsExecutionResults = plugin.CompleteProcessing(); pluginsExecutionResults.HasAdditionalTags.Should().BeTrue(); pluginsExecutionResults.AdditionalTags.Count.Should().Be(2); pluginsExecutionResults.AdditionalTags[0].Should().Be("9000.15.0427.2036"); pluginsExecutionResults.AdditionalTags[1].Should().Be("9.0.1"); } }
public void TestWithBothFiles() { var testWriterFactory = new TestWriterFactory(); using (var plugin = new LogShark.Plugins.Config.ConfigPlugin()) { plugin.Configure(testWriterFactory, null, null, new NullLoggerFactory()); foreach (var testCase in _testCases) { plugin.ProcessLogLine(testCase.GetLogLine(), testCase.LogType); } var pluginsExecutionResults = plugin.CompleteProcessing(); pluginsExecutionResults.HasAdditionalTags.Should().BeFalse(); } VerifyWritersState(testWriterFactory.Writers, _expectedConfigEntries, _expectedProcessInfoRecords); }
public void TestWithTabsvcOnly() { var testWriterFactory = new TestWriterFactory(); using (var plugin = new LogShark.Plugins.Config.ConfigPlugin()) { plugin.Configure(testWriterFactory, null, null, new NullLoggerFactory()); var filteredTestCases = _testCases.Where(testCase => testCase.LogType == LogType.TabsvcYml); foreach (var testCase in filteredTestCases) { plugin.ProcessLogLine(testCase.GetLogLine(), testCase.LogType); } } var expectedConfigEntries = _expectedConfigEntries.Where(entry => entry.FileName == "tabsvc.yml"); VerifyWritersState(testWriterFactory.Writers, expectedConfigEntries, new List <ConfigProcessInfo>()); testWriterFactory.Writers.Count.Should().Be(2); }
public void BadInput() { var processingNotificationsCollector = new ProcessingNotificationsCollector(10); var testWriterFactory = new TestWriterFactory(); using (var plugin = new LogShark.Plugins.Config.ConfigPlugin()) { plugin.Configure(testWriterFactory, null, processingNotificationsCollector, new NullLoggerFactory()); var wrongContentFormat = new LogLine(new ReadLogLineResult(123, "stringIsNotWhatConfigPluginExpects"), TestWorkgroupYmlInfo); var nullContent = new LogLine(new ReadLogLineResult(123, null), TestWorkgroupYmlInfo); plugin.ProcessLogLine(wrongContentFormat, LogType.WorkgroupYml); plugin.ProcessLogLine(nullContent, LogType.WorkgroupYml); plugin.CompleteProcessing(); } VerifyWritersState(testWriterFactory.Writers, new List <ConfigEntry>(), new List <ConfigProcessInfo>()); processingNotificationsCollector.TotalErrorsReported.Should().Be(2); }
public void TestWithWorkgroupOnly() { var testWriterFactory = new TestWriterFactory(); using (var plugin = new LogShark.Plugins.Config.ConfigPlugin()) { plugin.Configure(testWriterFactory, null, null, new NullLoggerFactory()); var filteredTestCases = _testCases.Where(testCase => testCase.LogType == LogType.WorkgroupYml); foreach (var testCase in filteredTestCases) { plugin.ProcessLogLine(testCase.GetLogLine(), testCase.LogType); } plugin.CompleteProcessing(); } var expectedConfigEntries = _expectedConfigEntries.Where(entry => entry.FileName == "workgroup.yml"); VerifyWritersState(testWriterFactory.Writers, expectedConfigEntries, _expectedProcessInfoRecords); }