private static void RunTestCasesAndAssertOutput <T>(List <PluginTestCase> testCases, List <T> outputList, IBackgrounderEventPersister persister) { var parser = new BackgrounderEventParser(persister, null); foreach (var testCase in testCases) { parser.ParseAndPersistLine(testCase.GetLogLine(), testCase.LogContents.ToString()); } var expectedOutput = testCases.Select(testCase => testCase.ExpectedOutput).ToList(); outputList.Should().BeEquivalentTo(expectedOutput); }
public BackgrounderEventParser(IBackgrounderEventPersister backgrounderEventPersister, IProcessingNotificationsCollector processingNotificationsCollector) { _backgrounderEventPersister = backgrounderEventPersister; _processingNotificationsCollector = processingNotificationsCollector; }
public void Configure(IWriterFactory writerFactory, IConfiguration pluginConfig, IProcessingNotificationsCollector processingNotificationsCollector, ILoggerFactory loggerFactory) { _backgrounderEventPersister = new BackgrounderEventPersister(writerFactory); _backgrounderEventParser = new BackgrounderEventParser(_backgrounderEventPersister, processingNotificationsCollector); _processingNotificationsCollector = processingNotificationsCollector; }
public BackgrounderEventPersisterTests() { _writerFactory = new TestWriterFactory(); _persister = new BackgrounderEventPersister(_writerFactory); }