public void ConvertTest_ResultCount_RemovedWithoutAddedLines()
        {
            IMergedLine line = new MergedLine(
                "1", null, null, LineStatus.Removed,
                new MergeConflict("fvn", "svn"));

            List<string> expected = new List<string>{};
            CoreConvertTest(line, expected);
        }
        public IMergedLine Merge(
            string origLine, 
            IChangedLine line1, 
            IChangedLine line2,
            string firstVariantName,
            string secondVariantName)
        {
            var origLineIndex = line1.OriginalLineIndex;
            LineStatus status = LineStatus.Survived;

            if(line1.Status == LineStatus.Removed || line2.Status == LineStatus.Removed)
                status = LineStatus.Removed;

            if(line1.Status == LineStatus.FirstEmptyRow || line2.Status == LineStatus.FirstEmptyRow)
                status = LineStatus.FirstEmptyRow;

            IMergeConflict mc = new MergeConflict(firstVariantName, secondVariantName)
            {
                FirstVariantLines = line1.AddedLinesAfter,
                SecondVariantLines = line2.AddedLinesAfter
            };

            var result = new MergedLine(
                origLine,
                origLineIndex,
                null,
                status,
                mc)
            {
                IsHaveConflict = false
            };

            // Проверяем, есть ли конфликт
            if (mc.FirstVariantLines.Count != 0 && mc.SecondVariantLines.Count == 0)
            {
                result.AddedLinesAfter = mc.FirstVariantLines;
            }
            else if (mc.FirstVariantLines.Count == 0 && mc.SecondVariantLines.Count != 0)
            {
                result.AddedLinesAfter = mc.SecondVariantLines;
            }
            else if (mc.FirstVariantLines.Count != 0 && mc.SecondVariantLines.Count != 0)
            {
                if (CheckConflict(mc, Comparer))
                {
                    result.AddedLinesAfter = mc.SecondVariantLines;
                }
                else
                {
                    result.IsHaveConflict = true;
                }
            }

            return result;
        }
        public void ConvertTest_ResultCount_SurvivedWithAddedLines()
        {
            IMergedLine line = new MergedLine(
                "1", null, null, LineStatus.Survived,
                new MergeConflict("fvn", "svn"));

            line.AddedLinesAfter = new List<string> { "2", "3" };

            List<string> expected = new List<string> {"1", "2", "3" };
            CoreConvertTest(line, expected);
        }
        public void ConvertTest_ResultCount_SurvivedWithConflict()
        {
            IMergedLine line = new MergedLine(
                "1", null, null, LineStatus.Survived,
                new MergeConflict("fvn", "svn"));

            line.AddedLinesAfter = new List<string> { "2", "3" };

            line.IsHaveConflict = true;
            line.MergeConflict.FirstVariantLines = new List<string> { "b", "b" };
            line.MergeConflict.SecondVariantLines = new List<string> { "q", "q" };

            List<string> expected = new List<string>
            {
                "1",
                line.MergeConflict.GetFrameAbove(),
                "b", "b",
                line.MergeConflict.GetFrameBetween(),
                "q", "q",
                line.MergeConflict.GetFrameBelow(),
            };

            CoreConvertTest(line, expected);
        }