示例#1
0
        public void Test_FormatPatch(string from, string to, string outputFile, int?start)
        {
            StringBuilder arguments = new();

            arguments.Append("format-patch --find-renames --find-copies --break-rewrites");
            if (start is not null)
            {
                arguments.AppendFormat(" --start-number {0}", start);
            }

            arguments.AppendFormat(" \"{0}\"..\"{1}\" -o \"{2}\"", from, to, outputFile);

            string dummyCommandOutput = "The answer is 42. Just check that the Git arguments are as expected.";

            _executable.StageOutput(arguments.ToString(), dummyCommandOutput);
            _gitModule.FormatPatch(from, to, outputFile, start).Should().Be(dummyCommandOutput);
        }