Ejemplo n.º 1
0
        public void GetUnifiedFormatHunkLine_WithTwoHunk_ExpectHunkLine()
        {
            //Arrange
            var gitDiffParser = new GitDiffParser(SecondGitDiff, 0);

            //Act
            List<Tuple<string, IEnumerable<string>>> unifiedFormatHunk = gitDiffParser.GetUnifiedFormatHunkLines().ToList();

            //Assert
            unifiedFormatHunk[0].Item1.ShouldBe("@@ -68,2 +67,0 @@ namespace skyeEditor.Core.Model.Dependency");
            unifiedFormatHunk[1].Item1.ShouldBe("@@ -170,0 +169,27 @@ namespace skyeEditor.Core.Model.Dependency");
            unifiedFormatHunk[2].Item1.ShouldBe("@@ -185,2 +209,0 @@ namespace skyeEditor.Core.Model.Dependency");
        }
Ejemplo n.º 2
0
        public void GetUnifiedFormatHunkLine_WithOneHunk_ExpectHunkLine()
        {
            //Arrange
            var gitDiffParser = new GitDiffParser(FirstGitDiff, 0);

            //Act
            var unifiedFormatHunk = gitDiffParser.GetUnifiedFormatHunkLines().ToList();

            //Assert
            unifiedFormatHunk[0].Item1.ShouldBe("@@ -41,0 +42,20 @@ namespace skyeEditor.Core.Model.Dependency");
        }
Ejemplo n.º 3
0
        public void GetHunkOriginalFile_WithOneHunk_ExpectHunkOriginalFile()
        {
            //Arrange
            var gitDiffParser = new GitDiffParser(FirstGitDiff, 0);

            //Act
            string hunkOriginalFile = gitDiffParser.GetHunkNewFile(gitDiffParser.GetUnifiedFormatHunkLines().First().Item1);

            //Assert
            hunkOriginalFile.ShouldBe("42,20");
        }
Ejemplo n.º 4
0
        public void GetUnifiedFormatHunkLine_DeleteDiff_ExpectedHunkLine()
        {
            //Arrange
            var gitDiffParser = new GitDiffParser(DiffOfADeleteOfThreeLines, 0);

            //Act
            var unifiedFormatHunk = gitDiffParser.GetUnifiedFormatHunkLines().ToList();

            //Assert
            unifiedFormatHunk[0].Item1.ShouldBe("@@ -7,3 +6,0 @@ using GitDiffMargin.Git;");
        }
Ejemplo n.º 5
0
        public void GetHunkOriginalFile_DeleteDiff_ExpectHunkOriginalFile()
        {
            //Arrange
            var gitDiffParser = new GitDiffParser(DiffOfADeleteOfThreeLines, 0);

            //Act
            var hunkOriginalFile = gitDiffParser.GetHunkNewFile(gitDiffParser.GetUnifiedFormatHunkLines().First().Item1);

            //Assert
            hunkOriginalFile.ShouldBe("6,0");
        }