public void OneVulnerability() { var reporter = new JsonReporter(_consoleWrapper.Object); reporter.Start(); reporter.Report(new Vulnerability { Code = "ExampleCode", Title = "Example Vulnerability", SeverityLevel = SeverityLevel.Critical, Description = "Description here.", FilePath = "C:\\Program.cs", FullyQualifiedName = "Namespace.Class", LineNumber = 10 }); reporter.Finish(); Assert.AreEqual(@"[ { ""Code"": ""ExampleCode"", ""Title"": ""Example Vulnerability"", ""SeverityLevel"": ""Critical"", ""Description"": ""Description here."", ""FilePath"": ""C:\\Program.cs"", ""FullyQualifiedName"": ""Namespace.Class"", ""LineNumber"": 10 } ] ".NormalizeEndOfLine(), _output.ToString()); }
public void NoVulnerabilities() { var reporter = new JsonReporter(_consoleWrapper.Object); reporter.Start(); reporter.Finish(); Assert.AreEqual(@"[] ".NormalizeEndOfLine(), _output.ToString()); }