Microsoft.CodeAnalysis.Sarif.SarifLoggerTests.SarifLogger_DoNotScrapeFilesFromNotifications C# (CSharp) Method

SarifLogger_DoNotScrapeFilesFromNotifications() private method

private SarifLogger_DoNotScrapeFilesFromNotifications ( ) : void
return void
        public void SarifLogger_DoNotScrapeFilesFromNotifications()
        {
            var sb = new StringBuilder();

            using (var textWriter = new StringWriter(sb))
            {
                using (var sarifLogger = new SarifLogger(
                    textWriter,
                    analysisTargets: null,
                    verbose: false,
                    computeTargetsHash: true,
                    logEnvironment: false,
                    prereleaseInfo: null,
                    invocationTokensToRedact: null))
                {
                    var toolNotification = new Notification
                    {
                        PhysicalLocation = new PhysicalLocation { Uri = new Uri(@"file:///file0.cpp") }
                    };
                    sarifLogger.LogToolNotification(toolNotification);

                    var configurationNotification = new Notification
                    {
                        PhysicalLocation = new PhysicalLocation { Uri = new Uri(@"file:///file0.cpp") }
                    };
                    sarifLogger.LogConfigurationNotification(configurationNotification);

                }
            }

            string logText = sb.ToString();
            var sarifLog = JsonConvert.DeserializeObject<SarifLog>(logText);

            sarifLog.Runs[0].Files.Should().BeNull();
        }