diff --git a/Configuration.cs b/Configuration.cs index bab2c67..62a54cd 100644 --- a/Configuration.cs +++ b/Configuration.cs @@ -8,9 +8,7 @@ namespace newsletter public class Reporter { public string ReporterClass { get; set; } - public string Url { get; set; } - public string Username { get; set; } - public string Password { get; set; } + public IEnumerable> Misc { get; set; } } } } \ No newline at end of file diff --git a/Reporters/Dummy.cs b/Reporters/Dummy.cs index 389fb6c..e5c051e 100644 --- a/Reporters/Dummy.cs +++ b/Reporters/Dummy.cs @@ -1,4 +1,5 @@ using HtmlAgilityPack; +using System.Text; using System.Threading.Tasks; namespace newsletter.Reporters @@ -8,9 +9,16 @@ namespace newsletter.Reporters #pragma warning disable CS1998 public override async Task Report(Configuration.Reporter config) { + var sb = new StringBuilder(); + sb.AppendLine("dummy node for testing purposes."); + if(config.Misc?.Any() == true) + foreach (var miscConfig in config.Misc) + { + sb.AppendLine($"{miscConfig.Key}: {miscConfig.Value}"); + } return new Report() { - ReportContent = HtmlNode.CreateNode($"
dummy node for testing purposes. Url: {config.Url}, Username: {config.Username}, Password: {config.Password}.
"), + ReportContent = HtmlNode.CreateNode($"
{sb.ToString()}
"), TextSummary = "dummy text for testing purposes" }; } diff --git a/sample-appsettings.json b/sample-appsettings.json index 97df911..02d7df4 100644 --- a/sample-appsettings.json +++ b/sample-appsettings.json @@ -1,11 +1,13 @@ { - "exportPath": "./newsletter.html", + "exportPath": "../newsletter.html", "reporters": [ { - "type":"dummy", - "url": "localhost:8080", - "username": "guy who didn't configure", - "password": "sordph1sh" + "reporterClass":"dummy", + "misc":[ + {"key": "url", "value": "localhost:8080"}, + {"key": "username", "value": "guy who didn't configure"}, + {"key": "password", "value": "sordph1sh"} + ] } ] } \ No newline at end of file