public void Parse_EmptyUnifiedDiff_Expect0HunkRangeInfos() { //Arrange var uniDiffParser = new UnifiedFormatDiffParser(EmptyUnifiedDiff, 0); //Act var hunkRangeInfos = uniDiffParser.Parse().ToList(); //Assert hunkRangeInfos.Count.ShouldBe(0); }
public void Parse_WithOneHunkWithoutLineCount_ExpectHunkRanges() { //Arrange var uniDiffParser = new UnifiedFormatDiffParser(ThirdUnifiedDiff, 0); //Act var hunkRanges = uniDiffParser.Parse().ToList(); //Assert hunkRanges[0].OriginalHunkRange.StartingLineNumber.ShouldBe(0); hunkRanges[0].OriginalHunkRange.NumberOfLines.ShouldBe(1); hunkRanges[0].NewHunkRange.StartingLineNumber.ShouldBe(0); hunkRanges[0].NewHunkRange.NumberOfLines.ShouldBe(1); }
public void Parse_WithThreeHunk_ExpectHunkRanges() { //Arrange var uniDiffParser = new UnifiedFormatDiffParser(SecondUnifiedDiff, 0); //Act var hunkRanges = uniDiffParser.Parse().ToList(); //Assert hunkRanges[0].OriginalHunkRange.StartingLineNumber.ShouldBe(67); hunkRanges[0].OriginalHunkRange.NumberOfLines.ShouldBe(2); hunkRanges[0].NewHunkRange.StartingLineNumber.ShouldBe(65); hunkRanges[0].NewHunkRange.NumberOfLines.ShouldBe(0); hunkRanges[1].OriginalHunkRange.StartingLineNumber.ShouldBe(169); hunkRanges[1].OriginalHunkRange.NumberOfLines.ShouldBe(0); hunkRanges[1].NewHunkRange.StartingLineNumber.ShouldBe(168); hunkRanges[1].NewHunkRange.NumberOfLines.ShouldBe(27); hunkRanges[2].OriginalHunkRange.StartingLineNumber.ShouldBe(184); hunkRanges[2].OriginalHunkRange.NumberOfLines.ShouldBe(2); hunkRanges[2].NewHunkRange.StartingLineNumber.ShouldBe(207); hunkRanges[2].NewHunkRange.NumberOfLines.ShouldBe(0); }