public void GetHunkNewFile_DeleteDiff_ExpectHunkNewFile() { //Arrange var gitDiffParser = new GitDiffParser(DiffOfADeleteOfThreeLines, 0); //Act var hunkOriginalFile = gitDiffParser.GetHunkOriginalFile(gitDiffParser.GetUnifiedFormatHunkLines().First().Item1); //Assert hunkOriginalFile.ShouldBe("7,3"); }
public void GetHunkNewFile_WithOneHunk_ExpectHunkNewFile() { //Arrange var gitDiffParser = new GitDiffParser(FirstGitDiff, 0); //Act string hunkOriginalFile = gitDiffParser.GetHunkOriginalFile(gitDiffParser.GetUnifiedFormatHunkLines().First().Item1); //Assert hunkOriginalFile.ShouldBe("41,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;"); }
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"); }
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"); }