BooLangStudioSpecs.StringParsing.BracketPairFinderTests.FindsTwoPairsWhenAdjacent C# (CSharp) Method

FindsTwoPairsWhenAdjacent() private method

private FindsTwoPairsWhenAdjacent ( ) : void
return void
        public void FindsTwoPairsWhenAdjacent()
        {
            string value = "()()";
            var finder = new BracketPairFinder(BracketPairType.Round);

            BracketPairCollection pairs = finder.FindPairs(value);

            Assert.Equal(2, pairs.Count);

            var pair = pairs.FindLeftByIndex(0);

            Assert.NotNull(pair);
            Assert.Equal(1, pair.RightIndex);

            pair = pairs.FindLeftByIndex(2);

            Assert.NotNull(pair);
            Assert.Equal(3, pair.RightIndex);
        }