コード例 #1
0
        public void RebaseUriCommand_RebaseRunWithArtifacts()
        {
            string testFilePath = "RunWithArtifacts.sarif";

            this.options = new RebaseUriOptions
            {
                BasePath           = @"C:\vs\src\2\s\",
                BasePathToken      = "SRCROOT",
                Inline             = true,
                SarifOutputVersion = SarifVersion.Current,
                PrettyPrint        = true
            };

            RunTest(testFilePath);
        }
コード例 #2
0
        private string RunRebaseUriCommand(string testFilePath, RebaseUriOptions options)
        {
            string inputSarifLog = Extractor.GetResourceText($"RebaseUriCommand.{testFilePath}");

            string        logFilePath         = @"c:\logs\mylog.sarif";
            StringBuilder transformedContents = new StringBuilder();

            options.TargetFileSpecifiers = new string[] { logFilePath };

            Mock <IFileSystem> mockFileSystem = ArrangeMockFileSystem(inputSarifLog, logFilePath, transformedContents);

            var rebaseUriCommand = new RebaseUriCommand(mockFileSystem.Object);

            int    returnCode   = rebaseUriCommand.Run(options);
            string actualOutput = transformedContents.ToString();

            returnCode.Should().Be(0);

            return(actualOutput);
        }