Ejemplo n.º 1
0
        public void CanCombineWithBothNextAndPreviousSection()
        {
            var s1       = new Section(10, 20, 2);
            var s3       = new Section(80, 100, 2);
            var sections = new List <Section> {
                s1, s3
            };

            var s2 = new Section(22, 79, 1);

            HighlighterHelper.AddToSection(sections, s2);

            sections.Count.ShouldBe(1);
            sections[0].Start.ShouldBe(s1.Start);
            sections[0].End.ShouldBe(s3.End);
            sections[0].DelimiterLength.ShouldBe(s3.DelimiterLength);
        }
Ejemplo n.º 2
0
        public void GiveALineNotInAnyExistingSection_ANewSectionAdded()
        {
            var s1       = new Section(10, 20, 2);
            var s3       = new Section(80, 100, 2);
            var sections = new List <Section> {
                s1, s3
            };

            var s2 = new Section(23, 78, 1);

            HighlighterHelper.AddToSection(sections, s2);

            sections.Count.ShouldBe(3);
            sections[0].ShouldBe(s1);
            sections[1].ShouldBe(s2);
            sections[2].ShouldBe(s3);
        }