コード例 #1
0
        private static SarifLog ExecuteTest(string path, string outputPath, string configuration = null)
        {
            var options = new ValidateOptions
            {
                TargetFileSpecifiers = new string[] { path },
                OutputFilePath       = outputPath,
                Force = true,
                ConfigurationFilePath = configuration
            };

            // Verify command returned success
            int returnCode = new ValidateCommand().Run(options);

            returnCode.Should().Be(0);

            return(SarifLog.Load(outputPath));
        }
コード例 #2
0
        private static SarifLog ExecuteTest(string path, string outputPath, string configuration = null)
        {
            var options = new ValidateOptions
            {
                TargetFileSpecifiers = new string[] { path },
                OutputFilePath       = outputPath,
                Force = true,
                ConfigurationFilePath = configuration,
                Kind = new List <ResultKind> {
                    ResultKind.Fail
                },
                Level = new List <FailureLevel> {
                    FailureLevel.Warning, FailureLevel.Error
                }
            };

            // Verify command returned success
            int returnCode = new ValidateCommand().Run(options);

            returnCode.Should().Be(0);

            return(SarifLog.Load(outputPath));
        }